This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients eryksun, nvutri, serhiy.storchaka
Date 2017-04-07.04:20:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491538816.79.0.762136220205.issue30009@psf.upfronthosting.co.za>
In-reply-to
Content
"%s" rounds float representation to 12 digits in Python 2.7. Replace "%s" with "%r" and you will get precise representation of floats.

int(4.01)        = 4
int(0.019999999999999574)        = 0
int(0.03999999999999915)         = 0
int(0.09999999999999787)         = 0
int(0.19999999999999574)         = 0
int(0.9999999999999787)  = 0
R = 0.009999999999999787

See also https://docs.python.org/2/tutorial/floatingpoint.html .
History
Date User Action Args
2017-04-07 04:20:16serhiy.storchakasetrecipients: + serhiy.storchaka, eryksun, nvutri
2017-04-07 04:20:16serhiy.storchakasetmessageid: <1491538816.79.0.762136220205.issue30009@psf.upfronthosting.co.za>
2017-04-07 04:20:16serhiy.storchakalinkissue30009 messages
2017-04-07 04:20:16serhiy.storchakacreate