Element-wise exponentiation

This was already discussed here, for example. The TLDR is, that the Julia parser special-cases literal integer exponents to call Base.literal_pow, which makes it possible to return a floating point value for negative powers without any type instabilities. If this were the case for non-literal integer powers as well, you’d either always have to return a floating point result, which is awkward, if you just want to work with integers, or introduce type instabilities, which would make ^ for integers significantly slower as a whole.

5 Likes