]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - misc/source/gmqcc-src/tests/exponentiation.qc
By fteqcc, hello gmqcc
[voretournament/voretournament.git] / misc / source / gmqcc-src / tests / exponentiation.qc
diff --git a/misc/source/gmqcc-src/tests/exponentiation.qc b/misc/source/gmqcc-src/tests/exponentiation.qc
new file mode 100644 (file)
index 0000000..5b8f24e
--- /dev/null
@@ -0,0 +1,14 @@
+float pow(float x, float y) {
+    return __builtin_pow(x, y);
+}
+
+void main() {
+    float hundy = pow(10, 2); // 10^2 == 100
+    print(ftos(hundy), "\n");      // prints: 100
+
+    hundy -= 90; // 100-90 = 10
+    print(ftos(hundy ** 2), "\n"); // prints: 100
+
+    hundy = 10.0f;
+    print(ftos(__builtin_exp(hundy)), "\n"); // prints: 22026.5
+}