diff options
author | Damien George <damien.p.george@gmail.com> | 2018-09-20 22:26:53 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-09-20 22:26:53 +1000 |
commit | 9849209ad8514ba19ca1c50ebab2d23b155c93ba (patch) | |
tree | 6c7ed1f9c900c6182733b9a5609f48419826ae70 /tests/float/float_parse.py | |
parent | b768cc6ca8ed6d7430b86dc7ccb9ee2391b3a251 (diff) | |
download | micropython-9849209ad8514ba19ca1c50ebab2d23b155c93ba.tar.gz micropython-9849209ad8514ba19ca1c50ebab2d23b155c93ba.zip |
tests/float/float_parse.py: Add tests for accuracy of small decimals.
Diffstat (limited to 'tests/float/float_parse.py')
-rw-r--r-- | tests/float/float_parse.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/float/float_parse.py b/tests/float/float_parse.py index 4b026de1c8..4b5fc613d3 100644 --- a/tests/float/float_parse.py +++ b/tests/float/float_parse.py @@ -30,3 +30,7 @@ print(float('1e4294967301')) print(float('1e-4294967301')) print(float('1e18446744073709551621')) print(float('1e-18446744073709551621')) + +# check small decimals are as close to their true value as possible +for n in range(1, 10): + print(float('0.%u' % n) == n / 10) |