mozilla/rust — pull request #9838 by vmx (2013-10-13 23:06:40+00:00)
Title: Add float to Ratio conversion

Add a function to create a Ratio out of a float
(f32 or f64).

I'm a newbie, hence this commit is meant as a first step to get something similar committed. I originally tried to port the `as_integer_ratio()` function from CPython, but then found out that the [IronPython's implementation][1] is even simpler.

So please let me know what needs to be done to make that a committable change.

[1]: https://ironpython.codeplex.com/SourceControl/latest#IronPython_2_6/Src/IronPython/Runtime/Operations/FloatOps.cs