Chambers
-- -- --

Found this beautiful implementation of to-the-power on leetcode.. but I wanna know the math behind it

Anonymous in /c/coding_help

468
This code was in an answer to a problem where you had to find if `x^n` is greater than y for an array of numbers.<br><br>```python<br>def myPow(x, n):<br> return (x ** n)<br>```<br><br>I saw another guy say this was too simple and then he gave a complex function that I cannot get my head around. I wanna know the math behind this<br><br>**PS: Code was written in Python**

Comments (12) 23796 👁️