Re: [Maxima-bugs] [ maxima-Bugs-713711 ] cf(-sqrt(2)) cf(sqrt(2)/sqrt(5)) cf...fpprec incorrect



>>>>> "Stavros" == Stavros Macrakis <stavros.macrakis@verizon.net> writes:

[I'm sending this maxima list and to your verizon address since your
mit address is bouncing my mail.]

    Stavros> fpprec:25;
    Stavros> cf(1.0b-25) => [0, 10000000000000000000000000]
    >> 
    >> 
    >> Interesting.  What system is this on?  I tried both examples on a Sun
    >> box with CMUCL, Clisp, and ACL6 and I get the second answer above.

    Stavros> What is the default fpprec on those systems?

16, as expected.

    Stavros> What do you get for the following:

    Stavros> fpprec:16;
    Stavros> fix(1.0b25);

9999999999999999832227840

    Stavros> fpprec:25;
    Stavros> fix(1.0b25);

10000000000000000000000000

    Stavros> 1.0b0+1.0b-22-1.0b0;
    Stavros> => 1.000113059364895023149213B-22
    Stavros> 1.000113059364895023149213B-22
    >> 
    >> Perhaps this is the explanation.  I get 9.998545654234722020008153B-23
    >> as the answer.

    Stavros> I still don't understand this one.  What is ?fpprec ?

fpprec is 25, as you set it.

Note that 1.0b-22 is

((BIGFLOAT SIMP 86) 73075081866545145910184242 -73)

and that 1.0b0+1.0b-22-1.0b0 is

((BIGFLOAT SIMP 86) 73064454222959150746304512 -73)

which seems reasonable.

Ray