Bill Allombert on Wed, 19 Oct 2011 21:32:18 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Parameters of floating-point arithmetic ?


On Tue, Oct 18, 2011 at 02:58:11PM -0400, jacques G wrote:
> 
> Question 1: Do the two PARI/GP programs below (flpari, flparam) work
> correctly on 64-bit machines ?
> 
> Question 2: Will the fast GP-specific flpari() program work in future versions of PARI/GP ?

In both case, it depends what you mean by work, but I think the answer is
1) yes and 2) no.

It happens that we are developping a new format for floating point numbers which will
allow precision to be set to any number of bits instead of words.

> flpari(p=precision(1.)) = {
>   local(w=#precision(1.,p));
>   [2, w, w*=64/#precision(1.,18), 2.>>w];
> }
> addhelp(flpari,"flpari(p): parameters of p-decimal PARI/GP floating-point arithmetic"\
> " [base, words, bits, machine epsilon]")

I see two problems: 

1) The use of # on a real number, which is not well-defined.

2) precision(1.,18) currently return 1. with 19 decimal digits instead of 18.
This will change in the future.

Cheers,
Bill.