Represents a number for use with Binary Calculator computations
| link | http://www.php.net/bcmath | 
|---|
__construct(mixed $number, int $scale) : void
mixedMay be of any type that can be cast to a string representation of a base 10 number
int(optional) Specifies the default number of digits after the decimal place to be used in operations for this BigNumber
__toString() : string
stringString representation of the number in base 10abs() : \Moontoast\Math\BigNumber
\Moontoast\Math\BigNumberfor fluent interfaceadd(mixed $number) : \Moontoast\Math\BigNumber
| link | http://www.php.net/bcadd | 
|---|
mixedMay be of any type that can be cast to a string representation of a base 10 number
\Moontoast\Math\BigNumberfor fluent interfacebaseConvert(string | int $number, int $fromBase, int $toBase) : string
stringintThe number to convert
int(optional) The base $number is in; defaults to 10
int(optional) The base to convert $number to; defaults to 16
stringceil() : \Moontoast\Math\BigNumber
compareTo(mixed $number) : int
Returns 0 if the two operands are equal, 1 if the current number is larger than the given number, -1 otherwise.
| link | http://www.php.net/bccomp | 
|---|
mixedMay be of any type that can be cast to a string representation of a base 10 number
intconvertFromBase10(string | int $number, int $toBase) : string
stringintThe number to convert
intThe base to convert $number to
| \InvalidArgumentException | if $toBase is outside the range 2 to 36 | 
|---|
stringconvertToBase(int $base) : string
intThe base to convert the current number to
stringString representation of the number in the given baseconvertToBase10(string | int $number, int $fromBase) : string
stringintThe number to convert
intThe base $number is in
| \InvalidArgumentException | if $fromBase is outside the range 2 to 36 | 
|---|
stringdecrement() : \Moontoast\Math\BigNumber
\Moontoast\Math\BigNumberfor fluent interfacedivide(mixed $number) : \Moontoast\Math\BigNumber
| link | http://www.php.net/bcdiv | 
|---|
mixedMay be of any type that can be cast to a string representation of a base 10 number
| \Moontoast\Math\Exception\ArithmeticException | if $number is zero | 
|---|
\Moontoast\Math\BigNumberfor fluent interfacefloor() : \Moontoast\Math\BigNumber
getScale() : int
If no scale was set, this will default to the value of bcmath.scale in php.ini.
intgetValue() : string
stringString representation of the number in base 10increment() : \Moontoast\Math\BigNumber
\Moontoast\Math\BigNumberfor fluent interfaceisEqualTo(mixed $number) : bool
mixedMay be of any type that can be cast to a string representation of a base 10 number
boolisGreaterThan(mixed $number) : bool
mixedMay be of any type that can be cast to a string representation of a base 10 number
boolisGreaterThanOrEqualTo(mixed $number) : bool
mixedMay be of any type that can be cast to a string representation of a base 10 number
boolisLessThan(mixed $number) : bool
mixedMay be of any type that can be cast to a string representation of a base 10 number
boolisLessThanOrEqualTo(mixed $number) : bool
mixedMay be of any type that can be cast to a string representation of a base 10 number
boolisNegative() : bool
boolisPositive() : bool
boolmod(mixed $number) : \Moontoast\Math\BigNumber
| link | http://www.php.net/bcmod | 
|---|
mixedMay be of any type that can be cast to a string representation of a base 10 number
| \Moontoast\Math\Exception\ArithmeticException | if $number is zero | 
|---|
\Moontoast\Math\BigNumberfor fluent interfacemultiply(mixed $number) : \Moontoast\Math\BigNumber
| link | http://www.php.net/bcmul | 
|---|
mixedMay be of any type that can be cast to a string representation of a base 10 number
\Moontoast\Math\BigNumberfor fluent interfacenegate() : \Moontoast\Math\BigNumber
\Moontoast\Math\BigNumberfor fluent interfacepow(mixed $number) : \Moontoast\Math\BigNumber
| link | http://www.php.net/bcpow | 
|---|
mixedMay be of any type that can be cast to a string representation of a base 10 number
\Moontoast\Math\BigNumberfor fluent interfacepowMod(mixed $pow, mixed $mod) : \Moontoast\Math\BigNumber
This is functionally equivalent to the following code:
    $n = new BigNumber(1234);
    $n->mod($n->pow(32), 2);
However, it uses bcpowmod(), so it is faster and can accept larger parameters.
| link | http://www.php.net/bcpowmod | 
|---|
mixedMay be of any type that can be cast to a string representation of a base 10 number
mixedMay be of any type that can be cast to a string representation of a base 10 number
| \Moontoast\Math\Exception\ArithmeticException | if $number is zero | 
|---|
\Moontoast\Math\BigNumberfor fluent interfacesetDefaultScale(int $scale) : void
int
setScale(int $scale) : \Moontoast\Math\BigNumber
intSpecifies the default number of digits after the decimal place to be used in operations for this BigNumber
\Moontoast\Math\BigNumberfor fluent interfacesetValue(mixed $number) : \Moontoast\Math\BigNumber
mixedMay be of any type that can be cast to a string representation of a base 10 number
\Moontoast\Math\BigNumberfor fluent interfacesignum() : int
int-1, 0 or 1 as the value of this BigNumber is negative, zero or positivesubtract(mixed $number) : \Moontoast\Math\BigNumber
| link | http://www.php.net/bcsub | 
|---|
mixedMay be of any type that can be cast to a string representation of a base 10 number
\Moontoast\Math\BigNumberfor fluent interfacefilterNumber(mixed $number) : string
mixed
string$numberScale : int
$numberValue : string