RIF can do this:

sage: x = RIF(0.33333333333333333333333333333333333)
sage: x.simplest_rational()
1/3

More generally, if you know a number to a certain precision:

sage: x = RIF(0.33333)
sage: y = x + RIF(-1,1)/1e3    # Add error term
sage: y.simplest_rational()
1/3

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to