In my opinion, the current behaviour is what makes the most sense
mathematically, but other disagree.
Another issue is the following two cases:
000000000000000000.0
and
0.000000000000000000
Should those both have the same precision? As Robert points out on the
ticket, this is related to what the definition of 'trailing zero' is.
Thanks,
Jason
Since a decimal point simply indicates a change of exponent in the
floating-point representation, I think these two certainly should have
the same precision. Think of the above numbers as
0000000000000000000e-1
and
0000000000000000000e-18
Jeroen
But we already have the convention that zeros after the decimal indicate
precision:
sage: a=4.000000000000000000000000000000
sage: a.prec()
103
sage: b=4.00000
sage: b.prec()
53
So there is already something special about where the decimal point is
placed.
Jason
I did not make a claim about
4.00000
Which they do, that's not the question here.
The question is really whether
0.00000000000000000000000000000000
should have the same precision as
1.00000000000000000000000000000000
I think it should, as the only semantic information trailing zeros
could possibly carry is an attempt to increase precision. I find the
fact that adding zeros to the latter increases precision, but adding
zeros to the former does not, to be surprising. To me, trailing zeros
are the unnecessary zeros to the right of a decimal expansion (whether
or not they come after a non-zero digit), and are used to denote
precision.
Whether 000000000000000000.0 and 0.000000000000000000 have the same
precision is a smaller question, but I'm inclined to say yes.
- Robert