[pypy-commit] pypy unsigned-dtypes: fix test_sin to deal with Float32's decreased precision

justinpeel noreply at buildbot.pypy.org
Fri Sep 2 21:30:16 CEST 2011


Author: Justin Peel <notmuchtotell at gmail.com>
Branch: unsigned-dtypes
Changeset: r47031:6801ef32508e
Date: 2011-09-02 13:29 -0600
http://bitbucket.org/pypy/pypy/changeset/6801ef32508e/

Log:	fix test_sin to deal with Float32's decreased precision

diff --git a/pypy/module/micronumpy/test/test_ufuncs.py b/pypy/module/micronumpy/test/test_ufuncs.py
--- a/pypy/module/micronumpy/test/test_ufuncs.py
+++ b/pypy/module/micronumpy/test/test_ufuncs.py
@@ -234,7 +234,7 @@
             assert b[i] == math.sin(a[i])
 
         a = sin(array([True, False], dtype=bool))
-        assert a[0] == sin(1)
+        assert abs(a[0] - sin(1)) < 1e-7 # a[0] will be less precise
         assert a[1] == 0.0
 
     def test_cos(self):


More information about the pypy-commit mailing list