Charles R Harris wrote: > > > On 10/14/06, *A. M. Archibald* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: [SNIP] > > > Hmmm, I wonder if we have a dictionary of precisions indexed by dtype > somewhere?
Here's some code I stole from somewhere for computing EPS. It would easy enough to generate the dictionary you are looking for at startup using this. I can't recall the pedigree of this code though, so caveat emptor: def bits_of_precision(dtype): one = np.array([1], dtype) i = 0 while not np.alltrue(one + (one / 2.**i) == one): i += 1 return i - 1 EPSS = 1.0 / 2**bits_of_precision(float) * 10 # XXX safety factor It's sorta old and translated from numpy too, so it could probably be rewritten in better style. -tim > [SNIP] ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion