FloatingPoint to Rational
thelonious opened this issue · comments
Kevin Lindsey commented
Is there an initializer or method to convert floats and doubles to rationals? I ended up writing my own conversions to Rational, but I wanted to check if I'm overlooking already existing support for that.
Matthias Zenger commented
Good point! I've added a new constructor to Rational
which approximates a given Double
up to a given precision.
Kevin Lindsey commented
That's an interesting implementation. Thanks for adding that!