Skip to content

Commit 9849209

Browse files
committed
tests/float/float_parse.py: Add tests for accuracy of small decimals.
1 parent b768cc6 commit 9849209

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/float/float_parse.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@
3030
print(float('1e-4294967301'))
3131
print(float('1e18446744073709551621'))
3232
print(float('1e-18446744073709551621'))
33+
34+
# check small decimals are as close to their true value as possible
35+
for n in range(1, 10):
36+
print(float('0.%u' % n) == n / 10)

0 commit comments

Comments
 (0)