0
(C++) Any way to rise a number to its square ?
I'm searching for a fonction possibly being in the C++ cmath library.
3 Réponses
+ 1
with math.h:
int n;
int sqrtN = sqrt(n);
int powN = pow(n,sqrtN);
powN its n elevated to N sqrtt
0
Just multiple the variable by itself.
eg. x *= x
or
x = x * x
- 1
pow(a, a*a) will work,