error adding 0.1



As Jaime says, the problem is that 1000! is too large to be represented as
a floating-point number.  In some implementations, float(1000!) returns a
NaN value, which Maxima isn't prepared to handle.

Maxima should do a better job of catching such issues and reporting them to
the user in a sensible way.


               -s

On Fri, Nov 23, 2012 at 9:34 AM, Jaime Villate <villate at fe.up.pt> wrote:

> On 11/23/2012 02:20 PM, Antonio Lapira wrote:
>
>> If I try to do:
>> (%i10) 1000!+1;
>> it works, while if I try this, I get an error message,
>>
>> (%i10) 1000!+0.1;
>>
> With the Lisp flavor that I'm using (SBCL) the error message tells you
> better what the problem is:
>
>    Too large to be represented as a DOUBLE-FLOAT
>
> You're trying to add an integer to a double-float, which forces the large
> integer to be converted into a double float. The solution would be to use
> bigfloats or rational numbers, depending on what you are doing,
>   1000!+0.1b0;
> or
>   1000!+rat(0.1);
> or even
>   1000!+rationalize(0.1);
>
> See:  ? bfloat, ? rat, ? rationalize
>
> Jaime
>
>
> ______________________________**_________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/**mailman/listinfo/maxima<http://www.math.utexas.edu/mailman/listinfo/maxima>;
>