Represents a number for use with Binary Calculator computations
link | http://www.php.net/bcmath |
---|
__construct(mixed $number, int $scale) : void
mixed
May 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
string
String representation of the number in base 10abs() : \Moontoast\Math\BigNumber
\Moontoast\Math\BigNumber
for fluent interfaceadd(mixed $number) : \Moontoast\Math\BigNumber
link | http://www.php.net/bcadd |
---|
mixed
May be of any type that can be cast to a string representation of a base 10 number
\Moontoast\Math\BigNumber
for fluent interfacebaseConvert(string | int $number, int $fromBase, int $toBase) : string
string
int
The number to convert
int
(optional) The base $number is in; defaults to 10
int
(optional) The base to convert $number to; defaults to 16
string
ceil() : \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 |
---|
mixed
May be of any type that can be cast to a string representation of a base 10 number
int
convertFromBase10(string | int $number, int $toBase) : string
string
int
The number to convert
int
The base to convert $number to
\InvalidArgumentException |
if $toBase is outside the range 2 to 36 |
---|
string
convertToBase(int $base) : string
int
The base to convert the current number to
string
String representation of the number in the given baseconvertToBase10(string | int $number, int $fromBase) : string
string
int
The number to convert
int
The base $number is in
\InvalidArgumentException |
if $fromBase is outside the range 2 to 36 |
---|
string
decrement() : \Moontoast\Math\BigNumber
\Moontoast\Math\BigNumber
for fluent interfacedivide(mixed $number) : \Moontoast\Math\BigNumber
link | http://www.php.net/bcdiv |
---|
mixed
May 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\BigNumber
for fluent interfacefloor() : \Moontoast\Math\BigNumber
getScale() : int
If no scale was set, this will default to the value of bcmath.scale in php.ini.
int
getValue() : string
string
String representation of the number in base 10increment() : \Moontoast\Math\BigNumber
\Moontoast\Math\BigNumber
for fluent interfaceisEqualTo(mixed $number) : bool
mixed
May be of any type that can be cast to a string representation of a base 10 number
bool
isGreaterThan(mixed $number) : bool
mixed
May be of any type that can be cast to a string representation of a base 10 number
bool
isGreaterThanOrEqualTo(mixed $number) : bool
mixed
May be of any type that can be cast to a string representation of a base 10 number
bool
isLessThan(mixed $number) : bool
mixed
May be of any type that can be cast to a string representation of a base 10 number
bool
isLessThanOrEqualTo(mixed $number) : bool
mixed
May be of any type that can be cast to a string representation of a base 10 number
bool
isNegative() : bool
bool
isPositive() : bool
bool
mod(mixed $number) : \Moontoast\Math\BigNumber
link | http://www.php.net/bcmod |
---|
mixed
May 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\BigNumber
for fluent interfacemultiply(mixed $number) : \Moontoast\Math\BigNumber
link | http://www.php.net/bcmul |
---|
mixed
May be of any type that can be cast to a string representation of a base 10 number
\Moontoast\Math\BigNumber
for fluent interfacenegate() : \Moontoast\Math\BigNumber
\Moontoast\Math\BigNumber
for fluent interfacepow(mixed $number) : \Moontoast\Math\BigNumber
link | http://www.php.net/bcpow |
---|
mixed
May be of any type that can be cast to a string representation of a base 10 number
\Moontoast\Math\BigNumber
for 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 |
---|
mixed
May be of any type that can be cast to a string representation of a base 10 number
mixed
May 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\BigNumber
for fluent interfacesetDefaultScale(int $scale) : void
int
setScale(int $scale) : \Moontoast\Math\BigNumber
int
Specifies the default number of digits after the decimal place to be used in operations for this BigNumber
\Moontoast\Math\BigNumber
for fluent interfacesetValue(mixed $number) : \Moontoast\Math\BigNumber
mixed
May be of any type that can be cast to a string representation of a base 10 number
\Moontoast\Math\BigNumber
for 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 |
---|
mixed
May be of any type that can be cast to a string representation of a base 10 number
\Moontoast\Math\BigNumber
for fluent interfacefilterNumber(mixed $number) : string
mixed
string
$numberScale : int
$numberValue : string