[Maxima] roundoff errors
raymond.toy at stericsson.com
Thu Mar 12 16:20:14 CDT 2009
Robert Dodier wrote:
> On 3/11/09, Raymond Toy <toy.raymond at gmail.com> wrote:
>> Expected behavior with floating point numbers. The numbers you give do
>> not have floating point values so they are rounded to the nearest
>> representable value. Use rationals if you want exact answers.
> Or maybe bigfloats -- for the examples shown, the rounding behavior
> might be less surprising.
> 325.65b0 + 471.67b0; => 7.9732b2
> 17.91b0 + 34.77b0; => 5.268b1
I think that's just hiding the problem. Bigfloats still have roundoff.
We just might not see it because the number of bits is enough to round
the desired way or because the way the numbers are printed rounds the
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
More information about the Maxima