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: Division betwen float and 100 not giving corect result
Type: behavior Stage: resolved
Components: Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: DimoY, christian.heimes
Priority: normal Keywords:

Created on 2021-01-12 11:12 by DimoY, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg384915 - (view) Author: Dimo Yordanov (DimoY) Date: 2021-01-12 11:12
To replicate what i think is a bug you need a python interpreter in any version. I think. When i type 2.7/100 it returns 0.027000000000000003, but it actually is 0.027 and 2.8/100 returns 0.027999999999999997. And i don't know why
msg384916 - (view) Author: Dimo Yordanov (DimoY) Date: 2021-01-12 11:15
And it appears that these are the only numbers (2.8 and 2.7) that behave like this
msg384917 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-01-12 11:18
This is the expected behavior for float. Python's floats are IEEE 754 double precision floats, not arbitrary preciscion floats. See https://docs.python.org/3/tutorial/floatingpoint.html
msg384918 - (view) Author: Dimo Yordanov (DimoY) Date: 2021-01-12 11:20
understandable. have a great day
History
Date User Action Args
2022-04-11 14:59:40adminsetgithub: 87073
2021-01-12 11:28:40christian.heimessetstatus: open -> closed
resolution: not a bug
2021-01-12 11:20:53DimoYsetstatus: closed -> open
versions: - Python 3.7
messages: + msg384918

components: - Interpreter Core
resolution: not a bug -> (no value)
2021-01-12 11:18:05christian.heimessetstatus: open -> closed

nosy: + christian.heimes
messages: + msg384917

resolution: not a bug
stage: resolved
2021-01-12 11:15:30DimoYsetmessages: + msg384916
2021-01-12 11:12:25DimoYcreate