gmqcc/tests/exponentiation.qc

15 lines
396 B
C++
Raw Normal View History

void main() {
2014-03-17 13:39:59 +00:00
float hundy = __builtin_pow(10, 2); // 10^2 == 100
print(ftos(hundy), "\n"); // prints: 100
2014-03-17 13:39:59 +00:00
hundy = pow(10, 2);
print(ftos(hundy), "\n");
hundy -= 90; // 100-90 = 10
print(ftos(hundy ** 2), "\n"); // prints: 100
2014-03-17 13:39:59 +00:00
print(ftos(pow(hundy, 2)), "\n"); // prints: 100
2013-03-08 03:46:25 +00:00
hundy = 10.0f;
print(ftos(__builtin_exp(hundy)), "\n"); // prints: 22026.5
}