From f0e086dbcf46c345a1a6c82ccba61bdf42237502 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Mon, 3 Aug 2009 22:06:12 +0000 Subject: Test fix for BSD buildbot error. --- numpy/testing/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'numpy/testing/utils.py') 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: -- cgit v1.2.1