]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - tests/arithexcept.qc
Merge branch 'arithmetic_exceptions' into cooking
[xonotic/gmqcc.git] / tests / arithexcept.qc
diff --git a/tests/arithexcept.qc b/tests/arithexcept.qc
new file mode 100644 (file)
index 0000000..6441f78
--- /dev/null
@@ -0,0 +1,13 @@
+const float huge = 340282346638528859811704183484516925440.000000; // FLT_MAX
+
+#ifdef DIVBYZERO
+const float a = 1.0 / 0.0;
+#endif
+
+#ifdef OVERFLOW
+const float a = huge * huge;
+#endif
+
+#ifdef UNDERFLOW
+const float a = 1 / huge;
+#endif