Python Forum
Calculation Question. - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Calculation Question. (/thread-24220.html)



Calculation Question. - parkch0708 - Feb-05-2020

Hello.

I used Anaconda 3, and I found wrong calculation result.

>>> 4.4 / 100
0.044000000000000004

Is this bug of Python?

Or did I use it wrong?

Please reply. Thanks.


RE: Calculation Question. - jefsummers - Feb-05-2020

Floating point in every language I know is an approximation. A very good approximation, but an approximation nonetheless.

https://docs.python.org/3/tutorial/floatingpoint.html