Closed droundy closed 5 years ago
Ratio<BigInt>::from_float
should be able to handle any finite value precisely, but returns None
for infinities and NaN. The more general Ratio<T>::approximate_float
makes a best effort for other integer types, but can also fail if the numerator or denominator would be out of range.
Neither of these are From
since they are fallible.
I missed this somehow. Thanks!
It would be lovely to be able to convert floating points to rational numbers.