Message365861
Hi ahmad, calculation with floating points in Python uses the IEE 754 (https://fr.wikipedia.org/wiki/IEEE_754) standard and will result in such quirks.
If you want to not loose precision you can use the decimal module:
>>> from decimal import Decimal
>>> Decimal('4.6')*100
Decimal('460.0')
Since this is not a bug if you have other questions when working with floats, try to ask on python-list or a forum. |
|
Date |
User |
Action |
Args |
2020-04-06 15:22:55 | remi.lapeyre | set | recipients:
+ remi.lapeyre, ahmad dana |
2020-04-06 15:22:55 | remi.lapeyre | set | messageid: <1586186575.31.0.470434133988.issue40206@roundup.psfhosted.org> |
2020-04-06 15:22:55 | remi.lapeyre | link | issue40206 messages |
2020-04-06 15:22:55 | remi.lapeyre | create | |
|