[issue20502] Context.create_decimal_from_float() inconsistent precision for zeros after decimal mark

Stefan Krah report at bugs.python.org
Tue Feb 4 15:46:50 CET 2014


Stefan Krah added the comment:

Mauricio de Alencar <report at bugs.python.org> wrote:
> 
> Mauricio de Alencar added the comment:
> 
> "Digits after the decimal mark" is not the same as "significant digits".
> See https://en.wikipedia.org/wiki/Significant_figures
> 
> If I have a list of numbers [256.2, 1.3, 0.5] that have 3 significant digits each, I would like to have them displayed as:
> ['256', '1.30', '0.500']

You need to stop lecturing.  The above sentence you wrote directly contradicts
the Wikipedia link you have thrown at us.  And yes, thank you, we do know what
significant figures are.

FYI, the Python implementation of decimal, the C implementation of decimal
and decNumber are completely separate implementations of

    http://speleotrove.com/decimal/decarith.html

by different authors and produce exactly the results that you criticize.

----------

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


More information about the Python-bugs-list mailing list