function BigNumber::toInt
Returns the exact value of this number as a native integer.
If this number cannot be converted to a native integer without losing precision, an exception is thrown. Note that the acceptable range for an integer depends on the platform and differs for 32-bit and 64-bit.
Throws
MathException If this number cannot be exactly converted to a native integer.
3 methods override BigNumber::toInt()
- BigDecimal::toInt in vendor/
brick/ math/ src/ BigDecimal.php - Returns the exact value of this number as a native integer.
- BigInteger::toInt in vendor/
brick/ math/ src/ BigInteger.php - Returns the exact value of this number as a native integer.
- BigRational::toInt in vendor/
brick/ math/ src/ BigRational.php - Returns the exact value of this number as a native integer.
File
-
vendor/
brick/ math/ src/ BigNumber.php, line 484
Class
- BigNumber
- Common interface for arbitrary-precision rational numbers.
Namespace
Brick\MathCode
public abstract function toInt() : int;