diff options
| author | Damien George | 2017-06-26 13:47:00 +1000 |
|---|---|---|
| committer | Damien George | 2017-06-26 13:47:00 +1000 |
| commit | 4a6c0fda784e9de346be92185f2f91b72e31f9db (patch) | |
| tree | 4720930117e78d58125ba06c7807c10e38778eab /tests/feature_check/float.py | |
| parent | c408ed9fb1e9922bedb02b9b4b3b441d6db8dc74 (diff) | |
tests: Auto detect floating point capabilites of the target.
The floating-point precision of the target is detected (0, 30, 32 or 64)
and only those tests which can run on the target will be run.
Diffstat (limited to 'tests/feature_check/float.py')
| -rw-r--r-- | tests/feature_check/float.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/feature_check/float.py b/tests/feature_check/float.py new file mode 100644 index 000000000..af93f5976 --- /dev/null +++ b/tests/feature_check/float.py @@ -0,0 +1,13 @@ +# detect how many bits of precision the floating point implementation has + +try: + float +except NameError: + print(0) +else: + if float('1.0000001') == float('1.0'): + print(30) + elif float('1e300') == float('inf'): + print(32) + else: + print(64) |
