You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see the point and do not want to argue about that (rounding is fine
for me). I just think this behaviour makes the long() function pretty
much useless.
Regards, Markus
Am 18.02.2008 um 13:25 schrieb Facundo Batista:
Facundo Batista added the comment:
In short:
>>> long(100 * 146.95)
14694L
This is NOT a bug, but a behaviour of binary floating point:
>>> 146.95
146.94999999999999
In binary you can not express this number exactly.
>>> 146.95 * 100
14694.999999999998
When you long() that, you truncate the number, so it goes to 14694.
Please address further discussion through python-list.
Thanks!
----------
nosy: +facundobatista
resolution: -> invalid
status: open -> closed
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: