Open ghost opened 8 years ago
Rational.of(0.00005)
Rational.of
(and indeed, all implicit conversion to Rational
) from a decimal has a maximum denominator of 1000 due to floating-point precision issues. I'll see if I can do anything about these cases.
Rational.of(1000000000000)
See:
> 1000000000000|0
-727379968
Numerators and denominators in Rational
can only be exact numbers.
@LegionMammal978 btw, could you add support for a cheddar constructor/casting. so Rational { 0.5 }
, Rational { 1, 2 }
, Rational::0.5
can all work?
Version: 1.0.0
Problem
Rationals don't support very big/very small numbers and sometimes produce incorrect result
Desired Behavior
Work correctly ._.
How to Reproduce
Rational.of(0.00005)
0 / 1
Rational.of(1000000000000)
-727379968 / 1
(Probably integer size issue, but ._.)