all computations to be done in extended precision?



On Dec 18, 2007 2:52 PM, S. Newhouse <sen1 at math.msu.edu> wrote:

> Is there a declaration at the beginning of a program to have all
> calculations done in extended precision?
>

No, but if all your floating constants are written as bfloats (3.1b0 rather
than 3.1 or 3.1e0), then all floating calculations will be performed in
bfloat. Beware: the precision of a bfloat literal depends on the value of
fpprec when it is *read*, not when it is *evaluated*, so it is best to use
exact numbers rather than bfloats in code.

For example:

f(x,y):= x^2 + y^2 / 5       (NOT y^2 / 5.0b0)
bfloat:40$
f(2.1b0,3.2b0)

It has been proposed to have a mode where floating notation reads as bfloat
rather than machine float by default, but I don't think that was ever
implemented.

         -s