[Gcl-devel] Re: [Maxima] float to bfloat



>>>>> "Camm" == Camm Maguire <camm@enhanced.com> writes:

    Camm> What could conceivably be achieved is that in the boxed protected
    Camm> arithmetic routines, which are going to be slow no matter what, to
    Camm> avoid checking for zero denominators etc. and rely on the floating
    Camm> point signal, the trapping of which could be linked into the error
    Camm> system (and turned off with ignore-errors, etc.)  I'm not sure if this
    Camm> would be useful from a speed standpoint, but it might be for a
    Camm> consistency with compiled code standpoint.

I'm pretty sure this is what cmucl does.  FP operations happen and if
there's a problem, an error of the appropriate type is signaled.  You
get to handle it however you want.  You also get to control under what
conditions the FP unit signals errors for things like overflow,
underflow, divide-by-zero, and invalid operations.

    Camm> In addition, right now the GCL printer triggers an error on NaN and
    Camm> Inf.  This could be easily remedied through the definition of the
    Camm> appropriate constants as lisp symbols.  I suppose this would be useful
    Camm> for clarity.

cmucl uses things like #.ext:double-float-positive-infinity and
#<DOUBLE-FLOAT Quiet NaN>  (since there are many representations of
NaN, but only one for each type of signed infinity).

Ray