diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2009-08-03 22:06:12 +0000 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2009-08-03 22:06:12 +0000 |
commit | f0e086dbcf46c345a1a6c82ccba61bdf42237502 (patch) | |
tree | 9d01579d49effe779e2182a21fe7b2c1ebf0e7a9 /numpy/testing/utils.py | |
parent | 2537604cbcb61027706c358d6dd6afcd99a30686 (diff) | |
download | numpy-f0e086dbcf46c345a1a6c82ccba61bdf42237502.tar.gz |
Test fix for BSD buildbot error.
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r-- | numpy/testing/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index 3e1a528ec..33f338bcc 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -474,11 +474,14 @@ def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=True): """ import math + from numpy.core import abs actual, desired = map(float, (actual, desired)) if desired==actual: return # Normalized the numbers to be in range (-10.0,10.0) - scale = float(pow(10,math.floor(math.log10(0.5*(abs(desired)+abs(actual)))))) + # scale = float(pow(10,math.floor(math.log10(0.5*(abs(desired)+abs(actual)))))) + scale = 0.5*(abs(desired) + abs(actual)) + scale = math.pow(10,math.floor(math.log10(scale))) try: sc_desired = desired/scale except ZeroDivisionError: |