[issue30752] Basic subtraction is wrong ( 1.83 - 1.52 == 0.31000000000000005)

2017-06-25 Thread Mark Dickinson

Mark Dickinson added the comment:

This is working as expected. Python's floats use the hardware-provided _binary_ 
floating-point format, which can't represent every finite decimal value 
exactly. I recommend reading 
https://docs.python.org/3.6/tutorial/floatingpoint.html for more information.

--
nosy: +mark.dickinson
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30752] Basic subtraction is wrong ( 1.83 - 1.52 == 0.31000000000000005)

2017-06-25 Thread René Podlogar

New submission from René Podlogar:

My Python-Installations Python 2.7.12, Python 3.4.5 @linux64
and the CLI on the python.org-Website (interactive shell) affected:

Python 3.6.0 (default, Jan 13 2017, 00:00:00) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1.83 - 1.52
0.31005
>>> 

Expected= 0.31

Verified in irc-channel #python.de

--
messages: 296817
nosy: René Podlogar
priority: normal
severity: normal
status: open
title: Basic subtraction is wrong ( 1.83 - 1.52 == 0.31005)
versions: Python 2.7, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com