BigRational

An arbitrarily large rational number. This class is immutable.
extends Brick\Math\BigNumber
Methods Summary
protected
# __construct( Brick\Math\BigInteger $numerator , Brick\Math\BigInteger $denominator , bool $checkDemominator )
Protected constructor. Use a factory method to obtain an instance.
public static
# of( \BigNumber|\number|string $value )
Creates a BigRational of the given value.

Overrides

public static
# nd( \BigNumber|\number|string $numerator , \BigNumber|\number|string $denominator )
Creates a BigRational out of a numerator and a denominator. If the denominator is negative, the signs of both the numerator and the denominator will be inverted to ensure that the denominator is always positive.
public static
# zero( )
Returns a BigRational representing zero.
public static
# one( )
Returns a BigRational representing one.
public static
# ten( )
Returns a BigRational representing ten.
public
public
public
# quotient( )
Returns the quotient of the division of the numerator by the denominator.
public
# remainder( )
Returns the remainder of the division of the numerator by the denominator.
public
# quotientAndRemainder( )
Returns the quotient and remainder of the division of the numerator by the denominator.
public
# plus( \BigNumber|\number|string $that )
Returns the sum of this number and the given one.
public
# minus( \BigNumber|\number|string $that )
Returns the difference of this number and the given one.
public
# multipliedBy( \BigNumber|\number|string $that )
Returns the product of this number and the given one.
public
# dividedBy( \BigNumber|\number|string $that )
Returns the result of the division of this number by the given one.
public
# power( int $exponent )
Returns this number exponentiated to the given value.
public
# reciprocal( )
Returns the reciprocal of this BigRational. The reciprocal has the numerator and denominator swapped.
public
# abs( )
Returns the absolute value of this BigRational.
public
# negated( )
Returns the negated value of this BigRational.
public
# simplified( )
Returns the simplified value of this BigRational.
public
# compareTo( $that )
{@inheritdoc}
public
# getSign( )
{@inheritdoc}
public
# toBigInteger( )
{@inheritdoc}
public
# toBigDecimal( )
{@inheritdoc}
public
# toBigRational( )
{@inheritdoc}
public
# toScale( int $scale , int $roundingMode = 0 )
{@inheritdoc}
public
# toInt( )
{@inheritdoc}
public
# toFloat( )
{@inheritdoc}
public
# __toString( )
{@inheritdoc}
Methods inherited from Brick\Math\BigNumber
of(), min(), max(), isEqualTo(), isLessThan(), isLessThanOrEqualTo(), isGreaterThan(), isGreaterThanOrEqualTo(), isZero(), isNegative(), isNegativeOrZero(), isPositive(), isPositiveOrZero(), getSign(), compareTo(), toBigInteger(), toBigDecimal(), toBigRational(), toScale(), toInt(), toFloat(), __toString(), jsonSerialize()