SF [2159499] Full bigfloat precision for Gamma after the second call
Subject: SF [2159499] Full bigfloat precision for Gamma after the second call
From: Stavros Macrakis
Date: Tue, 14 Oct 2008 13:06:29 -0400
On Tue, Oct 14, 2008 at 12:51 PM, Raymond Toy <raymond.toy at ericsson.com>wrote:
> fpprec:64;
> zot(bfloat(1/2),fpprec)$
> :lisp bigfloat%pi
> ((BIGFLOAT SIMP 438)
>
> 557478319480384710099680955233841104245484663623488188587759156163931561121116157458028029845525521685028647707875576434771246873456
> 2)
> :lisp (displa bigfloat%pi)
>
> 3.1415926535897932384626433832795028841971693993751058209749445923078164062862\
> 089986280348256812002485034480173261900300090541701233b0
>
> So, for some reason, zot computed a 438-bit value of pi. But compare
> this with the "true" value of pi:
>
I repeat: neither Lisp nor Maxima code should EVER look at bigfloat%pi,
which is an internal variable used as a cache by fppi. If you want the
bfloat value of pi, you should call (fppi) if you're in bfloat code (where
the (bigfloat simp NNN) part is implicit; if you're outside bfloat code, you
should call ($bfloat '$%pi).
And remember that the value of (fppi) is only valid for the *current* value
of fpprec.
Can you find a problem without looking at bigfloat%pi?
-s