Python Forum
python Calculation error: 39.8-0.1=39.699999999999996
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python Calculation error: 39.8-0.1=39.699999999999996
#1
this is windows system
and execute in DOS command

39.8-0.1=39.699999999999996


[Image: 924618-20190610173832764-1377276091.png]

Reason: https://docs.python.org/3/faq/design.htm...inaccurate
Reply
#2
floating point calculations.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
Thank you,buran
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python entropy calculation 12miki12 1 490 Dec-26-2023, 07:59 AM
Last Post: Gribouillis
  Calculation Inside Dictionary Error prophet11 3 2,555 Apr-22-2019, 05:23 AM
Last Post: perfringo
  Calculation error RustyShacklevert 4 2,788 Sep-25-2018, 04:29 AM
Last Post: RustyShacklevert

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020