[issue42890] bug float to int

2021-01-11 Thread Christian Heimes
Christian Heimes added the comment: Rounding errors are to be expected. Python uses IEEE-754 double precision floats. See https://docs.python.org/3/tutorial/floatingpoint.html -- nosy: +christian.heimes resolution: -> not a bug stage: -> resolved status: open -> closed type: -> beh

[issue42890] bug float to int

2021-01-11 Thread Wlodek
New submission from Wlodek : Python 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> f=0.1234/100 >>> f2= f*10**8 >>> i2= int(f2) >>> print("float=%f, float_2=%f, int(float_2)=%d" % (f, f2, int(f2))) float=0.0