[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Source view] [Print] [Project Stats]
An arbitrarily large rational number. This class is immutable.
File Size: | 479 lines (13 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
__construct(BigInteger $numerator, BigInteger $denominator, bool $checkDenominator) X-Ref |
Protected constructor. Use a factory method to obtain an instance. param: BigInteger $numerator The numerator. param: BigInteger $denominator The denominator. param: bool $checkDenominator Whether to check the denominator for negative and zero. |
of($value) X-Ref |
Creates a BigRational of the given value. param: BigNumber|int|float|string $value return: BigRational |
nd($numerator, $denominator) X-Ref |
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. param: BigNumber|int|float|string $numerator The numerator. Must be convertible to a BigInteger. param: BigNumber|int|float|string $denominator The denominator. Must be convertible to a BigInteger. return: BigRational |
zero() X-Ref |
Returns a BigRational representing zero. return: BigRational |
one() X-Ref |
Returns a BigRational representing one. return: BigRational |
ten() X-Ref |
Returns a BigRational representing ten. return: BigRational |
getNumerator() X-Ref |
return: BigInteger |
getDenominator() X-Ref |
return: BigInteger |
quotient() X-Ref |
Returns the quotient of the division of the numerator by the denominator. return: BigInteger |
remainder() X-Ref |
Returns the remainder of the division of the numerator by the denominator. return: BigInteger |
quotientAndRemainder() X-Ref |
Returns the quotient and remainder of the division of the numerator by the denominator. return: BigInteger[] |
plus($that) X-Ref |
Returns the sum of this number and the given one. param: BigNumber|int|float|string $that The number to add. return: BigRational The result. |
minus($that) X-Ref |
Returns the difference of this number and the given one. param: BigNumber|int|float|string $that The number to subtract. return: BigRational The result. |
multipliedBy($that) X-Ref |
Returns the product of this number and the given one. param: BigNumber|int|float|string $that The multiplier. return: BigRational The result. |
dividedBy($that) X-Ref |
Returns the result of the division of this number by the given one. param: BigNumber|int|float|string $that The divisor. return: BigRational The result. |
power(int $exponent) X-Ref |
Returns this number exponentiated to the given value. param: int $exponent The exponent. return: BigRational The result. |
reciprocal() X-Ref |
Returns the reciprocal of this BigRational. The reciprocal has the numerator and denominator swapped. return: BigRational |
abs() X-Ref |
Returns the absolute value of this BigRational. return: BigRational |
negated() X-Ref |
Returns the negated value of this BigRational. return: BigRational |
simplified() X-Ref |
Returns the simplified value of this BigRational. return: BigRational |
compareTo($that) X-Ref |
{@inheritdoc} |
getSign() X-Ref |
{@inheritdoc} |
toBigInteger() X-Ref |
{@inheritdoc} |
toBigDecimal() X-Ref |
{@inheritdoc} |
toBigRational() X-Ref |
{@inheritdoc} |
toScale(int $scale, int $roundingMode = RoundingMode::UNNECESSARY) X-Ref |
{@inheritdoc} |
toInt() X-Ref |
{@inheritdoc} |
toFloat() X-Ref |
{@inheritdoc} |
__toString() X-Ref |
{@inheritdoc} |
serialize() X-Ref |
This method is required by interface Serializable and SHOULD NOT be accessed directly. return: string |
unserialize($value) X-Ref |
This method is only here to implement interface Serializable and cannot be accessed directly. param: string $value return: void |
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |