X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=tests%2Fexponentiation.qc;h=199c4af1acbed7df669f43f85cec813258bd320b;hp=f3ab7d3c4370b041b8e7e4c1a59370a1d9878b9d;hb=01f3447e5bddceabb8997c71c653080903212913;hpb=12340a6bd077a5ff3454fe48913cfadb661f52cc diff --git a/tests/exponentiation.qc b/tests/exponentiation.qc index f3ab7d3..199c4af 100644 --- a/tests/exponentiation.qc +++ b/tests/exponentiation.qc @@ -1,11 +1,14 @@ -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 }