summaryrefslogtreecommitdiffstatshomepage
path: root/tests/float/float_parse.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-05-11 13:51:18 +1000
committerDamien George <damien.p.george@gmail.com>2018-05-11 13:51:18 +1000
commitd2c1db1e5cca03c9a34614af6d12045aefe3d719 (patch)
tree59b84f3b811f1bbaeb0124924fe3e714501b96da /tests/float/float_parse.py
parent6046e68fe19ca3e88e6e55438be9b2dee98723af (diff)
downloadmicropython-d2c1db1e5cca03c9a34614af6d12045aefe3d719.tar.gz
micropython-d2c1db1e5cca03c9a34614af6d12045aefe3d719.zip
tests/float/float_parse: Allow test to run on 32-bit archs.
Printing of uPy floats can differ by the floating-point precision on different architectures (eg 64-bit vs 32-bit x86), so it's not possible to using printing of floats in some parts of this test. Instead we can just check for equivalence with what is known to be the correct answer.
Diffstat (limited to 'tests/float/float_parse.py')
-rw-r--r--tests/float/float_parse.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/float/float_parse.py b/tests/float/float_parse.py
index 5eb16e79cf..ae6b114f03 100644
--- a/tests/float/float_parse.py
+++ b/tests/float/float_parse.py
@@ -17,8 +17,8 @@ print(float('.' + '9' * 70 + 'e-50') == float('1e-50'))
# tiny fraction with large exponent
print(float('.' + '0' * 60 + '1e10') == float('1e-51'))
-print(float('.' + '0' * 60 + '9e25'))
-print(float('.' + '0' * 60 + '9e40'))
+print(float('.' + '0' * 60 + '9e25') == float('9e-36'))
+print(float('.' + '0' * 60 + '9e40') == float('9e-21'))
# ensure that accuracy is retained when value is close to a subnormal
print(float('1.00000000000000000000e-37'))