[Numpy-svn] r3342 - trunk/numpy/lib

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Oct 16 12:44:13 CDT 2006


Author: oliphant
Date: 2006-10-16 12:44:09 -0500 (Mon, 16 Oct 2006)
New Revision: 3342

Modified:
   trunk/numpy/lib/getlimits.py
   trunk/numpy/lib/polynomial.py
Log:
Fix finfo eps and huge to be array scalars of the appropriate type.  And use finfo interface instead of MachAr.

Modified: trunk/numpy/lib/getlimits.py
===================================================================
--- trunk/numpy/lib/getlimits.py	2006-10-16 05:07:45 UTC (rev 3341)
+++ trunk/numpy/lib/getlimits.py	2006-10-16 17:44:09 UTC (rev 3342)
@@ -80,9 +80,9 @@
             setattr(self,word,getattr(machar, word))
         for word in ['tiny','resolution','epsneg']:
             setattr(self,word,getattr(machar, word).squeeze())
-        self.max = machar.huge.squeeze()
+        self.max = machar.huge.flat[0]
         self.min = -self.max
-        self.eps = machar.epsilon.squeeze()
+        self.eps = machar.eps.flat[0]
         self.nexp = machar.iexp
         self.nmant = machar.it
         self.machar = machar

Modified: trunk/numpy/lib/polynomial.py
===================================================================
--- trunk/numpy/lib/polynomial.py	2006-10-16 05:07:45 UTC (rev 3341)
+++ trunk/numpy/lib/polynomial.py	2006-10-16 17:44:09 UTC (rev 3342)
@@ -11,14 +11,14 @@
 import numpy.core.numeric as NX
 
 from numpy.core import isscalar, abs
-from numpy.lib.machar import MachAr
+from numpy.lib.getlimits import finfo
 from numpy.lib.twodim_base import diag, vander
 from numpy.lib.shape_base import hstack, atleast_1d
 from numpy.lib.function_base import trim_zeros, sort_complex
 eigvals = None
 lstsq = None
-_single_eps = MachAr(NX.single).eps
-_double_eps = MachAr(NX.double).eps
+_single_eps = finfo(NX.single).eps
+_double_eps = finfo(NX.double).eps
 
 class RankWarning(UserWarning):
     """Issued by polyfit when Vandermonde matrix is rank deficient.



More information about the Numpy-svn mailing list