]> git.xonotic.org Git - xonotic/gmqcc.git/blob - tests/exponentiation.qc
error about too many elements in initializer; added test for initialized arrays:...
[xonotic/gmqcc.git] / tests / exponentiation.qc
1 float pow(float x, float y) {
2     return __builtin_pow(x, y);
3 }
4
5 void main() {
6     float hundy = pow(10, 2); // 10^2 == 100
7     print(ftos(hundy), "\n");      // prints: 100
8
9     hundy -= 90; // 100-90 = 10
10     print(ftos(hundy ** 2), "\n"); // prints: 100
11
12     hundy = 10.0f;
13     print(ftos(__builtin_exp(hundy)), "\n"); // prints: 22026.5
14 }