getting the fractional part of a real?

Roy Smith roy at panix.com
Sat Aug 15 20:17:39 CEST 2009


What's the best way to get the fractional part of a real?  The two ways I 
can see are r % 1 and r = int(r), but both seem a bit hokey.  Is there 
something more straight-forward that I'm missing, like fraction(r)?



More information about the Python-list mailing list