mini\Util\Math\Decimal::compare() Method

public

Signature

public function compare(mini\Util\Math\BigInt|self|string|int|float $other): int

Parameters

Name Type Default Description
$other mini\Util\Math\BigInt|self|string|int|float required Documentation missing

Returns

int

Documentation

Compare: returns -1 if less, 0 if equal, 1 if greater

Comparison is by numeric value, not representation: Decimal::of('1.00', 2)->compare('1') === 0

Source

src/Util/Math/Decimal.php:522-527