[New-bugs-announce] [issue31684] Scientific formatting of decimal 0 different from float 0

Aaron Meurer report at bugs.python.org
Tue Oct 3 17:46:21 EDT 2017


New submission from Aaron Meurer <asmeurer at gmail.com>:

>>> '{:+.19e}'.format(0.)
'+0.0000000000000000000e+00'
>>> import decimal
>>> '{:+.19e}'.format(decimal.Decimal(0))
'+0.0000000000000000000e+19'

Note the decimal uses e+19 instead of e+00. Obviously it's still mathematically correct, but it's annoying to have anything other than e+00 for a 0 value.

----------
messages: 303653
nosy: Aaron.Meurer
priority: normal
severity: normal
status: open
title: Scientific formatting of decimal 0 different from float 0

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31684>
_______________________________________


More information about the New-bugs-announce mailing list