error adding 0.1



As Jaime says, you can do this with bfloats, e.g. 1000! + 0.1b0

On Fri, Nov 23, 2012 at 9:41 AM, Antonio Lapira <antoniolapira at yahoo.it>wrote:

> so, can't I get the whole number ending with ........0000000000000.1 ?
>
>
> --- Ven 23/11/12, Jaime Villate <villate at fe.up.pt> ha scritto:
>
> > Da: Jaime Villate <villate at fe.up.pt>
> > Oggetto: Re: [Maxima] error adding 0.1
> > A: "Antonio Lapira" <antoniolapira at yahoo.it>
> > Cc: maxima at math.utexas.edu
> > Data: Venerd? 23 novembre 2012, 14:34
> > 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
>