I must be missing something, but when I try to create a BigRational
from double
value 0.1
it gives me a really long nonsense value. Converting it back gives 0.0
:
double d = 0.1; // 0.1
BigRational br = new BigRational(d); // 3602879701896397/71213961919824440...
double d2 = (double)br; // 0.0
What am I missing? I know 0.1 is not representable exactly in a System.Double
but surely BigRational
can approximate it well enough to round-trip it?
As @elgonzo explains:
A commenter on the referenced work item uploaded a fix that reads in 0.1 correctly.