aboutsummaryrefslogtreecommitdiff
path: root/tests/feature_check/float.py
diff options
context:
space:
mode:
authorDamien George2017-06-26 13:47:00 +1000
committerDamien George2017-06-26 13:47:00 +1000
commit4a6c0fda784e9de346be92185f2f91b72e31f9db (patch)
tree4720930117e78d58125ba06c7807c10e38778eab /tests/feature_check/float.py
parentc408ed9fb1e9922bedb02b9b4b3b441d6db8dc74 (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.py13
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)