[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/brick/math/src/ -> BigNumber.php (summary)

Common interface for arbitrary-precision rational numbers.

File Size: 528 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 19 functions

  of()
  floatToString()
  create()
  min()
  max()
  sum()
  add()
  cleanUp()
  isEqualTo()
  isLessThan()
  isLessThanOrEqualTo()
  isGreaterThan()
  isGreaterThanOrEqualTo()
  isZero()
  isNegative()
  isNegativeOrZero()
  isPositive()
  isPositiveOrZero()
  jsonSerialize()

Functions
Functions that are not part of a class:

of($value)   X-Ref
Creates a BigNumber of the given value.

The concrete return type is dependent on the given value, with the following rules:

- BigNumber instances are returned as is
- integer numbers are returned as BigInteger
- floating point numbers are converted to a string then parsed as such
- strings containing a `/` character are returned as BigRational
- strings containing a `.` character or using an exponential notation are returned as BigDecimal
- strings containing only digits with an optional leading `+` or `-` sign are returned as BigInteger

param: BigNumber|int|float|string $value
return: BigNumber

floatToString(float $float)   X-Ref
Safely converts float to string, avoiding locale-dependent issues.

param: float $float
return: string

create(... $args)   X-Ref
Proxy method to access protected constructors from sibling classes.

param: mixed ...$args The arguments to the constructor.
return: static

min(...$values)   X-Ref
Returns the minimum of the given values.

param: BigNumber|int|float|string ...$values The numbers to compare. All the numbers need to be convertible
return: static The minimum value.

max(...$values)   X-Ref
Returns the maximum of the given values.

param: BigNumber|int|float|string ...$values The numbers to compare. All the numbers need to be convertible
return: static The maximum value.

sum(...$values)   X-Ref
Returns the sum of the given values.

param: BigNumber|int|float|string ...$values The numbers to add. All the numbers need to be convertible
return: static The sum.

add(BigNumber $a, BigNumber $b)   X-Ref
Adds two BigNumber instances in the correct order to avoid a RoundingNecessaryException.

param: BigNumber $a
param: BigNumber $b
return: BigNumber

cleanUp(string $number)   X-Ref
Removes optional leading zeros and + sign from the given number.

param: string $number The number, validated as a non-empty string of digits with optional sign.
return: string

isEqualTo($that)   X-Ref
Checks if this number is equal to the given one.

param: BigNumber|int|float|string $that
return: bool

isLessThan($that)   X-Ref
Checks if this number is strictly lower than the given one.

param: BigNumber|int|float|string $that
return: bool

isLessThanOrEqualTo($that)   X-Ref
Checks if this number is lower than or equal to the given one.

param: BigNumber|int|float|string $that
return: bool

isGreaterThan($that)   X-Ref
Checks if this number is strictly greater than the given one.

param: BigNumber|int|float|string $that
return: bool

isGreaterThanOrEqualTo($that)   X-Ref
Checks if this number is greater than or equal to the given one.

param: BigNumber|int|float|string $that
return: bool

isZero()   X-Ref
Checks if this number equals zero.

return: bool

isNegative()   X-Ref
Checks if this number is strictly negative.

return: bool

isNegativeOrZero()   X-Ref
Checks if this number is negative or zero.

return: bool

isPositive()   X-Ref
Checks if this number is strictly positive.

return: bool

isPositiveOrZero()   X-Ref
Checks if this number is positive or zero.

return: bool

jsonSerialize()   X-Ref
{@inheritdoc}




Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer