Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BigNumber.php

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\Math

Code

public abstract function toInt() : int;

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal