[Maxima] roundoff errors

Volker van Nek volkervannek at googlemail.com
Fri Mar 13 02:27:59 CDT 2009

```Ray, in your example just take fpprec 26, which I believe is correct,
because you want 26 valid digits.

(%i1) fpprec:26\$
(%i2) 1b0+1b-25;
(%o2)                    1.0000000000000000000000001b0
(%i3) slength(string(%));
(%o3)                                 29

Remembering the PI computations I did some time ago I found that time that
fpprec is very precise. E.g. the following shows that a correct rounding was
made at the 30. valid digit.

(%i4) fpprec:30\$
(%i5) bfloat(%pi);
(%o5)                  3.14159265358979323846264338328b0
(%i6) slength(string(%));
(%o6)                                 33
(%i7) fpprec:32\$
(%i8) bfloat(%pi);
(%o8)                 3.1415926535897932384626433832795b0

Greetings
Volker

Raymond Toy schrieb:
>
> For example, with fpprec:25,
>
> 1b0+1b-25 => 1.0b0
>
> But %-1b0 => 1.039757...b-25.
>
> I would have preferred that maxima print 1.000000...01b0 for the first
> result.
>
> Ray
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>

```