Mark Dickinson added the comment:

I also agree that we shouldn't change the current code. As Raymond says, it may 
be worth a doc change.

Serge: I was confused by your initial report. If I understand the StackOverflow 
question correctly, this isn't about the output for *infinite* numbers (e.g., 
`Decimal('inf')` and `Decimal('-inf')`), and I'm not sure what that would mean. 
Rather, it's about the output for small finite numbers, where an exponent 
wouldn't be used in the normal scientific notation. So some people would 
(understandably) rather see:

>>> Decimal('123456').to_eng_string()
'123.456e3'
>>> Decimal('0.02').to_eng_string()
'20e-3'

than the current

>>> Decimal('123456').to_eng_string()
'123456'
>>> Decimal('0.02').to_eng_string()
'0.02'

for example. Is that what you meant? 

Stefan: IEEE 754 does cover formatting (in section 5.12, "Details of conversion 
between floating-point data and external character sequences"), but has nothing 
to say about engineering formats.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26223>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to