Hi!

I run into Python error in rounding and not know how to predict when it will
occur in order to prevent wrong result.
What can I do to assure accurate result?

>>> "%.2f" % 0.445
'0.45'                                   correct
>>> "%.2f" % 0.455
'0.46'                                   correct
>>> "%.2f" % 0.465
'0.47'                                   correct
>>> "%.2f" % 0.475
'0.47'                                   not correct
>>> "%.2f" % 0.485
'0.48'                                   not correct
>>> "%.2f" % 0.495
'0.50'                                   correct

Neven
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to