Subject: How to deal with r^(bfloat(2/3))/r^(2.0/3)
From: Stavros Macrakis
Date: Thu, 13 Dec 2007 10:20:34 -0500
Why are you using approximate numbers (float and bfloat) in the first
place? If it's possible to preserve exact numbers through the whole
calculation, perhaps you can avoid this problem entirely?
Also, why are you mixing float and bfloat calculations? Float has
fixed precision (about 16 decimal digits) while bfloat has settable
precision.
-s
On 12/13/07, zycentre <zycentre-sub at yahoo.com.cn> wrote:
> Yes, that's my fault. I used "fpprec: 5$" before, and then, just
> "kill(all);".
> If I quit maxima first, and restart, the result is:
> (%i1) bfloat(2/3)-2.0/3;
> (%o1) 4.163336342344337b-17
>
> I still want this small value to be vanished, as it will appear in an index.
> When the result have one term like:
> r^4.163336342344337b-17
> looks not good.
>
> So, how to set in maxima, such as: if INDEX < 1.b-16, set INDEX =0 ?
> How to translate it into maxima language?
>
> Sincerely yours,
> Yuanchuan Zou
>
> >On Dec 12, 2007 11:27 AM, zycentre <zycentre-sub at yahoo.com.cn> wrote:
> >> (%i6) (bfloat(2/3))-(2.0/3);
> >> (%o6) -.19073b-6
> >
> >In Maxima, "2.0" is a machine floating-point number, so the result in
> >this case may not be exact. You might want to try
> >bfloat(2/3)-(2.0b0/3).
> >
> >However, with default settings, the error should be < 1.0e-16, and I
> >cannot reproduce your result with any settings. In fact, on my system
> >(Maxima 5.13.0 on GCL 2.6.8), this returns 0.0b0.
> >
> >Could you please tell us the version of Maxima you are using? Does
> >this happen in a fresh Maxima? If not, what special settings are you
> >using?
> >
> > -s
>
>
>
>