bfloat precision question



Sheldon Newhouse wrote:
>
> Following the earlier discussion in this thread (thanks fo RJF and 
> Barton), I wrote the following function which relates fpprec and ?fpprec.
>
> (%t112) fp_bits(n):=floor(log(bfloat(10)^n)/log(bfloat(2)))+3
>   

Why experiment when we have the actual source code? :-)

Thus, fpprec is computed from $fpprec via the function fpprec1.  (Great
function name!  No way to figure that out except by reading the code 
And you can't figure out how to call fpprec1 without reading more code
to see how it's used.)

Anyway, fpprec1 computes fpprec as (+ 2 (integer-length (expt 10
$fpprec))).  This is pretty much what Sheldon has, except there's a
potential for roundoff in his formula.  Probably doesn't occur for
sensible values of $fpprec.

Ray