This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Bad result of calculation
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, jbertoli
Priority: normal Keywords:

Created on 2006-08-22 07:15 by jbertoli, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
py_calc.PNG jbertoli, 2006-08-22 07:15 wrong_digits
Messages (2)
msg29610 - (view) Author: Jean-Christophe BERTOLINI (jbertoli) Date: 2006-08-22 07:15
In the Python Shell enter:
>>> 3.84-4.5
-0.66000000000000014

The last digits of the calculation result are wrong
msg29611 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-08-22 08:20
Logged In: YES 
user_id=849994

This is due to how floats work. See
http://www.python.org/doc/faq/general/#why-are-floating-point-calculations-so-inaccurate
.
History
Date User Action Args
2022-04-11 14:56:19adminsetgithub: 43874
2006-08-22 07:15:10jbertolicreate