Serious error in int() function?

Marko Rauhamaa marko at pacujo.net
Wed Apr 13 03:55:04 EDT 2016


martin.spichty at gmail.com:

> there may be a serious error in python's int() function:
>
> print int(float(2.8/0.1))
>
> yields
>
> 27
>
> instead of 28!!

It is not an error but a normal artifact of decimal-to-binary
conversion.


Marko



More information about the Python-list mailing list