float(sin(2^2048))?



On 5/11/10 9:21 AM, Stavros Macrakis wrote:
> Things like this do not seem worth special-casing. Floating-point has
> well-understood limitations, and Maxima offers bfloat when you want to
> escape (some of) them.
>
> It would be far more valuable in general if we could integrate IEEE
> floats into Maxima (in this case, getting a NaN). But that is a bigger
> project....
>
>   
Having NaN would be nice. 

But I know I would not like float(sin(2^2048)) to return NaN.  It is a
number since |sin(x)| <= 1 and is easily represented as a float, even if
we can't easily get that number. 

I also hate getting NaN at the end of a long computation.   I'd much
rather get an error at the offending place than have NaN propagate
everywhere.  (At least for me, whenever my programs produced NaN, it was
caused by a mistake on my part.  Solving such a mistake is so much
easier if the program crashed at that point instead of producing NaN.)

Ray