Re: printing floats, bigfloats, fortran floats



>>>>> "Stavros" == Stavros Macrakis  writes:

    >> I think the problem is with the printing. Format controls are
    >> wonderful for producing human-readable syntax, but many controls such
    >> as ~g do not necessarily preserve print/read consistency.


    Stavros> This is a well-known problem which was solved if I
    Stavros> remember correctly in a paper in CACM in the early
    Stavros> 1970's, as well as by Jonl in the Maclisp system.  It is
    Stavros> a particularly important problem for systems like Maxima
    Stavros> which use textual forms (not binary) as the primary form
    Stavros> of file storage. If our current read/print routines
    Stavros> aren't well behaved, we should improve them!

Currently (and previously), printing of floating-point numbers is
controlled by fpprec, so we won't have read/print consistency.  In
addition, maxima uses ~e and or ~f to print the numbers, and that
doesn't guarantee read/print consistency either.  

If we changed it so fpprec didn't control the number of digits
printed, and used prin1 (from Lisp) to output numbers, we should have
read/print consistency.  Or at least, we can put the blame on the
underlying Lisp for having a broken prin1 and/or reader. :-) (Well,
except that I think maxima reads the numbers itself, instead of using
Lisp, so that could well be broken too.)

Ray