Created
September 1, 2021 20:37
-
-
Save alsamitech/f1d9ed716eb67cefa91c8c7494318a0e to your computer and use it in GitHub Desktop.
longpow - exponent function in 3 lines
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
long longpow(const long val, long pw){ | |
long res=val; | |
while(--pw)res*=val; | |
return res; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment