Allocating extra bits for mantissa of a float

John D. McCalpin mccalpin at masig3.ocean.fsu.edu
Fri Aug 25 20:54:06 AEST 1989


In article <13884 at netnews.upenn.edu>, rowe at pender.ee.upenn.edu (Mickey Rowe) writes:
> I'm trying to find the zeroes of a function that blows up in an
> extremely narrow range.  To find these zeroes, I'm searching for
> places where the function becomes negative.  My problem is that the
> width of the curve where the function is negative may be smaller than
> 1e-16 where the value of the indepenent variable is on the order of
> 1e+2.  This requires that the mantissa of my variable retain at least
> (in some cases probably more) 18 significant figures.  Is there any
> (even remotely simple) way to get such precision without building my
> own computer?  I am currently working on a sun (I'm not sure of more
> than that except that it uses SunOS release 4.0).

Although I have not used it for any significant programming, the 'bc'
program on your Sun has a C-like syntax and user-specifiable precision.
If it is a small piece of code, it might be relatively easy to re-write
it in bc.  The man page is a bit sketchy, but is should get you started.

There are reports of bugs in bc if you ask for more than about 47 decimal
digits of accuracy, but that should not be a difficulty for this problem.
Good luck....
--
John D. McCalpin - mccalpin at masig1.ocean.fsu.edu - mccalpin at nu.cs.fsu.edu
		   mccalpin at delocn.udel.edu



More information about the Comp.lang.c mailing list