[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Minor CLISP bug #2

>>>>> "Bruno" == Bruno Haible <haible@ilog.fr> writes:

    Bruno> M. Thomas <thommark@access.digex.net> writes:

    >> I like CLISP's facility for setting the precision of floating-point
    >> numbers.  There does appear to be a small glitch, however:
    >> > (setf (long-float-digits) 100)
    >> 100
    >> > (/ pi 2.)
    >> 1.5707963267948966192313216916397514421L0
    >> > (asin 3.4L0)
    >> #C(1.5707964 -1.894559012672297804279889265261663451844L0)
    >> ;;; expected both realpart and imagpart to have the specified
    >> ;;; long-float precision:
    >> ;;; #C(1.5707963267948966192313216916397514421L0
    >> -1.894559012672297804279889265261663451844L0)

    Bruno> The real part here does not depend on the input, therefore - in theory -
    Bruno> it should be pi/2 with infinite precision. This is not representable, so
    Bruno> clisp chooses the format contained in the variable *default-float-format*.
    Bruno> Try (setq *default-float-format* 'long-float).

I have to disagree here.  The real part does in general depend on the
input, otherwise the result might not have been complex.

Also, doesn't ANSI CL say the parts of a complex are supposed to be
the same type?  Therefore both should have been long floats.