macro power(x: typed; num: static int): untyped
general purpose power using ^ for integers, which works for any type by rewriting to a product of *.
For the special cases of -1, 0, 1 we simply rewrite to the correct result. Negative powers are written as 1 / x^p
Source
Edit