Closed valerii15298 closed 1 year ago
Did you not look at the result of a1.div(a2)
before calling other methods on it?
console.log(a1.div(a2).toString()) // '0.33333333333333333333'
Look at the documentation for div
and precision
.
Also, notice that toFraction
can take a maximum-denominator argument. For example:
console.log(a1.div(a2).toFraction(100).toString()) // '1, 3'
Seems there is a bug when preforming division with cyclic float numbers: