function BigRational::dividedBy
Returns the result of the division of this number by the given one.
Parameters
BigNumber|int|float|string $that The divisor.:
Throws
MathException If the divisor is not a valid number, or is zero.
File
-
vendor/
brick/ math/ src/ BigRational.php, line 248
Class
- BigRational
- An arbitrarily large rational number.
Namespace
Brick\MathCode
public function dividedBy(BigNumber|int|float|string $that) : BigRational {
$that = BigRational::of($that);
$numerator = $this->numerator
->multipliedBy($that->denominator);
$denominator = $this->denominator
->multipliedBy($that->numerator);
return new BigRational($numerator, $denominator, true);
}