3 ms·
The use of != there is very confusing but what they mean is stores a precision along each number, not that -0 != -0.0 e.g. in Python: >>> from decimal imp
by alextgordon 10y ago
The use of != there is very confusing but what they mean is stores a precision along each number, not that -0 != -0.0
e.g. in Python:
>>> from decimal import Decimal as D
>>> 2 * D("1.0")
Decimal('2.0')
>>> 2 * D("1.000")
Decimal('2.000')
>>> D("1.0") == D("1.000")
True
- Ericson2314 10y agoThat just means == is a "lossy" equivalence relation. I rather the precision be truely observable----every number is "infinite precision". Once can always include natural as extra field if one cares about empirical precision.
- tjonker 10y agoI'm having a bit of trouble parsing this, but Ion decimal values are not "infinite precision". Every decimal has a very specific, finite precision. It's a standard "coefficient and exponent" model, with no specification-enforced limit on either.
- Ericson2314 10y agoThe idea is each number is adequately precise in that additional precision would mean additional useless trailing zeros.