"Richard D. Moores" <[email protected]> wrote

def float_to_exact_number_stored_in_computer(f):
  from decimal import Decimal
  return Decimal.from_float(f)

I've just borrowed from the doc, but that name is too long, isn't it? Please
suggest something shorter but still meaningful.

If it were C I'd say f2d()
But since its Python why not float2Decimal()?
Since thats what it actually does...


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to