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: While condition not satisfied embarrassingly
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Agniva Roychowdhury, ezio.melotti
Priority: normal Keywords:

Created on 2015-07-18 15:24 by Agniva Roychowdhury, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python1.py Agniva Roychowdhury, 2015-07-18 15:24 The python source code and the output attached as comment.
Messages (2)
msg246903 - (view) Author: Agniva Roychowdhury (Agniva Roychowdhury) Date: 2015-07-18 15:24
A simple while loop that prints a variable 'test' (initialized by 0.0 and incremented by 0.1 in the loop) with a condition test<1.0 prints values UPTO 1.0.
It is a serious error.
Please check attached file and the output.
msg246904 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2015-07-18 15:34
This is expected:
>>> .1+.1+.1+.1+.1+.1+.1+.1+.1+.1
0.9999999999999999

See https://docs.python.org/3/tutorial/floatingpoint.html for further info.
History
Date User Action Args
2022-04-11 14:58:19adminsetgithub: 68850
2015-07-18 15:34:09ezio.melottisetstatus: open -> closed

nosy: + ezio.melotti
messages: + msg246904

resolution: not a bug
stage: resolved
2015-07-18 15:29:02Agniva Roychowdhurysetversions: + Python 2.7, - Python 3.6
2015-07-18 15:24:23Agniva Roychowdhurycreate