[issue28744] Basic precision calc error

Renner report at bugs.python.org
Fri Nov 18 20:52:48 EST 2016


New submission from Renner:

Simple code:
 print('%.55f' %(1.1 + 2.2 - 3.3))
 print('%.55f' %(1.1 + 2.2))
is supposed to produce
 0.0000000000000000000000000000000000000000000000000000000
 3.3000000000000000000000000000000000000000000000000000000
But when I run it, Actually it produces 
 0.0000000000000004440892098500626161694526672363281250000
 3.3000000000000002664535259100375697016716003417968750000

Found by chance...

python 3.5.2
sysname:'Darwin'
release:'15.6.0
version:'Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64')

----------
components: Interpreter Core
messages: 281191
nosy: Renner
priority: normal
severity: normal
status: open
title: Basic precision calc error
type: behavior
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28744>
_______________________________________


More information about the Python-bugs-list mailing list