The pow function for integers
-
Is there a function like pow (for doubles) for integers? I could of course use the pow function, but there just _must_ be some function like it for other datatypes too. Or is the fastest way to calculate x raised to the power of y by making a loop and multiplying x with itself y times? (faster than pow?) Sprudling
-
Is there a function like pow (for doubles) for integers? I could of course use the pow function, but there just _must_ be some function like it for other datatypes too. Or is the fastest way to calculate x raised to the power of y by making a loop and multiplying x with itself y times? (faster than pow?) Sprudling
This is right out of the MSDN. //----------------------------- pow template complex pow(const complex& x, int y); template complex pow(const complex& x, const T& y); template complex pow(const complex& x, const complex& y); template complex pow(const T& x, const complex& y); The functions each effectively convert both operands to the return type, then return the converted x to the power y. The branch cut for x is along the negative real axis. //------------------------------ Vu vucsuf