function BigNumber::compareTo
Compares this number to the given one.
@psalm-return -1|0|1
Return value
int -1 if `$this` is lower than, 0 if equal to, 1 if greater than `$that`.
Throws
MathException If the number is not valid.
5 calls to BigNumber::compareTo()
- BigNumber::isEqualTo in vendor/
brick/ math/ src/ BigNumber.php - Checks if this number is equal to the given one.
- BigNumber::isGreaterThan in vendor/
brick/ math/ src/ BigNumber.php - Checks if this number is strictly greater than the given one.
- BigNumber::isGreaterThanOrEqualTo in vendor/
brick/ math/ src/ BigNumber.php - Checks if this number is greater than or equal to the given one.
- BigNumber::isLessThan in vendor/
brick/ math/ src/ BigNumber.php - Checks if this number is strictly lower than the given one.
- BigNumber::isLessThanOrEqualTo in vendor/
brick/ math/ src/ BigNumber.php - Checks if this number is lower than or equal to the given one.
3 methods override BigNumber::compareTo()
- BigDecimal::compareTo in vendor/
brick/ math/ src/ BigDecimal.php - Compares this number to the given one.
- BigInteger::compareTo in vendor/
brick/ math/ src/ BigInteger.php - Compares this number to the given one.
- BigRational::compareTo in vendor/
brick/ math/ src/ BigRational.php - Compares this number to the given one.
File
-
vendor/
brick/ math/ src/ BigNumber.php, line 444
Class
- BigNumber
- Common interface for arbitrary-precision rational numbers.
Namespace
Brick\MathCode
public abstract function compareTo(BigNumber|int|float|string $that) : int;