[Numpy-discussion] Solaris Sparc build broken
Charles R Harris
Thu Nov 5 00:57:54 CST 2009
On Wed, Nov 4, 2009 at 11:30 PM, David Cournapeau <
> Charles R Harris wrote:
> > I don't think it's that bad. Leaving out the ppc and sticking to ieee,
> > there is only double precision, extended precision and quad precision
> > versions of long double and they are easily determined at run time.
> How would you determine this at runtime ?
Excepting the PPC, just loop adding a number to one, dividing it by two at
each iteration, and stop when the result is equal to one. There has been a
version of that in the scipy zeros module since forever.
/* Determine relative precision of doubles, assumes binary */
for(tol = 1; tol + 1 != 1; tol /= 2);
scipy_zeros_rtol = 2*tol;
Or you could just do byte comparisons against known numbers.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion