[Maxima] rational to float

Raymond Toy toy@rtp.ericsson.se
25 Jun 2001 08:20:06 -0400


>>>>> "willisb" == willisb  <willisb@unk.edu> writes:

    willisb> simp.lisp incorrectly sets machine-mantissa-precision to be 24:

    willisb> (eval-when (compile load)
    willisb>      (defvar machine-mantissa-precision 24 );;is this correct
    willisb> )

    willisb> For double precision, machine-mantissa-precision  should be 53;
    willisb> changing it corrects the problem with the precision of the rational
    willisb> to float conversion.   For Common Lisp, float.lisp correctly defines
    willisb> machine-mantissa-precision with

    willisb>         MACHINE-MANTISSA-PRECISION
    willisb>         #+(OR PDP10 H6180)   27.
    willisb>         #+cl(integer-length (integer-decode-float most-positive-double-float))

Would this not be better expressed as (float-digits 1d0)?

Ray