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: adding or subtracting decimals
Type: Stage: resolved
Components: Windows Versions: Python 3.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: QA.Nathaniel Logarta, paul.moore, steve.dower, tim.golden, xtreak, zach.ware
Priority: normal Keywords:

Created on 2019-09-04 07:41 by QA.Nathaniel Logarta, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
adding or subtracting decimals.PNG QA.Nathaniel Logarta, 2019-09-04 07:41 Adding or subtracting decimals
Messages (2)
msg351117 - (view) Author: QA.Nathaniel Logarta (QA.Nathaniel Logarta) Date: 2019-09-04 07:41
Just try to add decimals
It doesn't have any trigger on my end
As long as it is a complex decimal or adding decimal zeroes to non-zero
msg351118 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-09-04 07:53
Please include the text of the repl session in issue so that it would be easy to copy past and also more accessible. The issue is as below in the attached image. I guess this is due to floating point representation and has some possible solutions in this page : https://docs.python.org/3/tutorial/floatingpoint.html and https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate

$ python3
Python 3.8.0b4 (v3.8.0b4:d93605de72, Aug 29 2019, 21:47:47)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 17.00005 + 6169.90760
6186.907649999999
>>> from decimal import Decimal
>>> Decimal('17.00005') + Decimal('6169.90760')
Decimal('6186.90765')
History
Date User Action Args
2022-04-11 14:59:19adminsetgithub: 82205
2019-09-04 08:04:08serhiy.storchakasetstatus: open -> closed
resolution: not a bug
stage: resolved
2019-09-04 07:53:13xtreaksetnosy: + xtreak
messages: + msg351118
2019-09-04 07:41:52QA.Nathaniel Logartacreate