Message392928
Please study the docs first:
https://docs.python.org/3/tutorial/floatingpoint.html
That will give you the background to understand why `int()` has nothing to do with this.
>>> 1.9999999999999999
2.0
That is, `int()` was passed 2.0 to begin with, because the binary float closest to the decimal value 1.9999999999999999 is in fact 2.0.
If you can't live with that, use the `decimal` module instead:
>>> import decimal
>>> int(decimal.Decimal("1.9999999999999999"))
1 |
|
Date |
User |
Action |
Args |
2021-05-04 17:36:05 | tim.peters | set | recipients:
+ tim.peters, paul.moore, tim.golden, zach.ware, steve.dower, hbutt4319 |
2021-05-04 17:36:05 | tim.peters | set | messageid: <1620149765.06.0.537151622403.issue44034@roundup.psfhosted.org> |
2021-05-04 17:36:05 | tim.peters | link | issue44034 messages |
2021-05-04 17:36:05 | tim.peters | create | |
|