]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - tests/exponentiation.qc
renaming the length operator to _length and fixing the lexing of that operator, gener...
[xonotic/gmqcc.git] / tests / exponentiation.qc
index 5b8f24e155b776f570202d5d2789ead95ba71bf9..199c4af1acbed7df669f43f85cec813258bd320b 100644 (file)
@@ -1,13 +1,13 @@
-float pow(float x, float y) {
-    return __builtin_pow(x, y);
-}
-
 void main() {
-    float hundy = pow(10, 2); // 10^2 == 100
+    float hundy = __builtin_pow(10, 2); // 10^2 == 100
     print(ftos(hundy), "\n");      // prints: 100
 
+    hundy = pow(10, 2);
+    print(ftos(hundy), "\n");
+
     hundy -= 90; // 100-90 = 10
     print(ftos(hundy ** 2), "\n"); // prints: 100
+    print(ftos(pow(hundy, 2)), "\n"); // prints: 100
 
     hundy = 10.0f;
     print(ftos(__builtin_exp(hundy)), "\n"); // prints: 22026.5