[Ecls-list] [Maxima] Maxima/ECL combination not printing a leading zero

Raymond Toy toy.raymond at gmail.com
Sun Aug 8 19:31:57 UTC 2010

 On 8/6/10 10:56 AM, Dr. David Kirkby wrote:
> A work-around might be to set the Maxima global variable
>> maxfpprintprec to something greater than 16 (the default).
>> Does that help?
> I'm not keen on that. A double-precision number in IEE-754 format has
> 53-bits in the significand, so the precision is
> In[23]:= Log[10,2^53] //N
> Out[23]= 15.9546
> decimal digits.
> In that case, printing 16 digits (Maxima's default) seems reasonable,
> but printing 17 digits does not.
Since the floating-point number base is 2 and not 10, there are issues
to be solved when converting from one to the other.  From the examples,
it is pretty clear that 16 digits is NOT always enough to convert the
base 2 number to base 10 if you want the result to be the nearest base
10 number closes to the floating-point base 2 number.
> Printing a leading zero makes sense to me - printing digits unlikely
> to be correct does not.
Why is printing a non-significant leading zero more important than
printing the number correctly to the last digit?  I'd much rather see
the last correct digit than the irrelevant leading 0.
> As a second point, failing to print the leading zero is an
> inconstancy, as sometimes it's printed.
Yes, it is inconsistent on the assumption that it should be printed.  
It's not inconsistent if the criterion is to print out as many digits as
needed to represent the number as accurately as possible given the
constraint that the result takes 17 characters.


More information about the ecl-devel mailing list