aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/brick/math/src/BigRational.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/brick/math/src/BigRational.php')
-rw-r--r--vendor/brick/math/src/BigRational.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/vendor/brick/math/src/BigRational.php b/vendor/brick/math/src/BigRational.php
index bee094f73..46257814d 100644
--- a/vendor/brick/math/src/BigRational.php
+++ b/vendor/brick/math/src/BigRational.php
@@ -20,17 +20,13 @@ final class BigRational extends BigNumber
{
/**
* The numerator.
- *
- * @var BigInteger
*/
- private $numerator;
+ private BigInteger $numerator;
/**
* The denominator. Always strictly positive.
- *
- * @var BigInteger
*/
- private $denominator;
+ private BigInteger $denominator;
/**
* Protected constructor. Use a factory method to obtain an instance.
@@ -433,7 +429,8 @@ final class BigRational extends BigNumber
*/
public function toFloat() : float
{
- return $this->numerator->toFloat() / $this->denominator->toFloat();
+ $simplified = $this->simplified();
+ return $simplified->numerator->toFloat() / $simplified->denominator->toFloat();
}
/**