[Numpy-svn] r5005 - trunk/numpy/core/tests

numpy-svn@scip... numpy-svn@scip...
Wed Apr 9 13:19:25 CDT 2008


Author: charris
Date: 2008-04-09 13:19:23 -0500 (Wed, 09 Apr 2008)
New Revision: 5005

Modified:
   trunk/numpy/core/tests/test_regression.py
Log:
Add test for string to float conversions of various types.


Modified: trunk/numpy/core/tests/test_regression.py
===================================================================
--- trunk/numpy/core/tests/test_regression.py	2008-04-09 18:04:59 UTC (rev 5004)
+++ trunk/numpy/core/tests/test_regression.py	2008-04-09 18:19:23 UTC (rev 5005)
@@ -980,6 +980,15 @@
         """Ticket #714"""
         np.zeros(10)[np.array(0)]
 
+    def check_floats_from_string(self, level=rlevel):
+        """Ticket #640, floats from string"""
+        fsingle = np.single('1.234')
+        fdouble = np.double('1.234')
+        flongdouble = np.longdouble('1.234')
+        assert_almost_equal(fsingle, 1.234)
+        assert_almost_equal(fdouble, 1.234)
+        assert_almost_equal(flongdouble, 1.234)
 
+
 if __name__ == "__main__":
     NumpyTest().run()



More information about the Numpy-svn mailing list