Last active
July 29, 2016 06:24
-
-
Save bhumpert/8af0ba7b6d50864b1e5e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [23]: def test_17(n): | |
....: for _ in range(n): | |
....: x = random() | |
....: assert x == float('{:1.16e}'.format(x)) | |
....: print('Test success') | |
....: | |
In [24]: test_17(1000000) | |
Test success | |
In [27]: def test_16(n): | |
for _ in range(n): | |
x = random() | |
assert x == float('{:1.15e}'.format(x)) | |
print('Test success') | |
....: | |
In [28]: test_16(1000000) | |
--------------------------------------------------------------------------- | |
AssertionError Traceback (most recent call last) | |
<ipython-input-28-f4fed7690d1e> in <module>() | |
----> 1 test_16(1000000) | |
<ipython-input-27-d3a9aed9c7ce> in test_16(n) | |
2 for _ in range(n): | |
3 x = random() | |
----> 4 assert x == float('{:1.15e}'.format(x)) | |
5 print('Test success') | |
6 | |
AssertionError: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i remember this gist