[issue45995] string formatting: normalize negative zero
Serhiy Storchaka
report at bugs.python.org
Mon Dec 6 07:15:51 EST 2021
Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:
To normalize negative 0.0 to 0.0 you can just add 0.0. It will work with any method of converting floats to string, there is no need to change all formatting specifications.
>>> x = -0.0
>>> x
-0.0
>>> x + 0.0
0.0
----------
nosy: +mark.dickinson, serhiy.storchaka
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________
More information about the Python-bugs-list
mailing list