in c++, ^ is the bitwise exclusive OR operator.
to raise an integer to a power, use std::pow
( #include <cmath>
)
eg: double result = std::pow( double(3), 3 ) ;
vmanes commented: Good catch on subtle aspect +3
superjacent commented: To the point and relevant advice, thank you. +1
Moporho commented: Brilliant! +1
agrawalashishku commented: Very Very helpful. I am grateful +2
VernonDozier commented: Useful function. +1
hammerhead commented: nice one +2