/** * Returns the result of the division of this number by the given one. * * @param BigNumber|number|string $that The divisor. * * @return BigRational The result. * * @throws ArithmeticException If the divisor is not a valid number, or is zero. */ public function dividedBy($that) { $that = BigRational::of($that); $numerator = $this->numerator->multipliedBy($that->denominator); $denominator = $this->denominator->multipliedBy($that->numerator); return new BigRational($numerator, $denominator, true); }