Gerhard Niklasch on Wed, 4 Mar 1998 03:18:05 +0100


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

Re: dependence of format and realprecision


In response to
> Message-Id: <3.0.1.32.19980303210307.006a24d4@alcor.concordia.ca>
> Date: 	Wed, 4 Mar 1998 03:03:07 +0100
> From: Jack Fearnley <jack@alcor.concordia.ca>
> 
[...]
> I happen to be summing L-series to see if they sum to zero so I need a lot
> of internal precision but I do not need lots of decimal places cluttering
> up my screen.
> 
> In GP-2alpha the format seems to be locked into the realprecision.  That is
> to say that when I change format the real precision changes accordingly.
> 
> Am I missing something here or is there some reason why the previous
> flexibility is no longer provided?

But it is, provided that you chant the right incantations.

In 2.0 native mode (`compatible' set to zero):
---8<---
(03:07) gp > default(realprecision ,100)
   realprecision = 100 significant digits
(03:07) gp > default(format)  
   format = g0.100
(03:07) gp > default(format,"g0.20")
   format = g0.20
(03:07) gp > Pi
%1 = 3.1415926535897932384
(03:07) gp > \x
[&=001a7010] 0500000d  40800001  c90fdaa2  2168c234  c4c6628b  80dc1cd1
  29024e08  8a67cc74  020bbea6  3b139b22  514a0879  8e3404dd  ef9519b3  
--->8---
(so increasing the precision does change the format, but there is no
problem changing the format afterwards to whatever may be convenient).

Passing to full compatibility mode:
---8<---
(03:09) gp > default(compatible,3)
  ***   Warning: user functions re-initialized.
   compatible = 3 (use old functions, ignore case )
(03:12) gp > \precision=100
   realprecision = 100 significant digits
(03:12) gp > \format=g0.20
   format = g0.20
(03:12) gp > Euler
%2 = 0.57721566490153286060
(03:12) gp > \x
[&=001a7e10] 0500000d  407fffff  93c467e3  7db0c7a4  d1be3f81  0152cb56
  a1cecc3a  f65cc019  0c03df34  709affbd  8e4b59fa  03a9f0ee  d0649ccb  
--->8---

Suggestion for the future:  This kind of question and response would
have given some life to the pari-users list...

Shameless Plug(tm):  Since you're posting this from Concordia, Montreal
and I'm typing from the U Laval campus -- fancy coming over to Quebec to
our little Pari-2.0.6.alpha demonstration tomorrow morning at 09:30 am,
Pavillon Alexandre Vachon, room #1610?  (In broken Franglais, I haven't
quite mastered the Quebecois accent yet! ;^)  Otherwise, see you in
the number theory seminar on Thursday...

Enjoy, Gerhard