Is there a simple way to achieve the following in sbcl and / or ecl:
I use (sb-ext::set-floating-point-modes :traps nil) to make sbcl generate
things like #.SB-EXT:DOUBLE-FLOAT-POSITIVE-INFINITY. Curiously, float itself
still signals an error, when called with a large integer.
(float (expt 10 1000) 0.0d0)
Could somebody send me the magic to change this. (I.e., I'd like to get
POSITIVE-INFINITY, NEGATIVE-INFINITY, NAN depending on the first argument I'm
giving to float)
Many thanks,
Martin
Martin Rubey <············@univie.ac.at> writes:
> Is there a simple way to achieve the following in sbcl and / or ecl:
>
> I use (sb-ext::set-floating-point-modes :traps nil) to make sbcl generate
> things like #.SB-EXT:DOUBLE-FLOAT-POSITIVE-INFINITY. Curiously, float itself
> still signals an error, when called with a large integer.
>
> (float (expt 10 1000) 0.0d0)
>
> Could somebody send me the magic to change this. (I.e., I'd like to get
> POSITIVE-INFINITY, NEGATIVE-INFINITY, NAN depending on the first argument I'm
> giving to float)
for what it's worth, for the moment I just use a self made float that checks
whether its first argument is bigger than most-positive-double-float or smaller
than most-negative-double-float.
Martin