# Element-wise exponentiation

**URL:** <https://discourse.julialang.org/t/element-wise-exponentiation/43480>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 22, 2020, 9:48am UTC](https://discourse.julialang.org/t/element-wise-exponentiation/43480 "2020-07-22T09:48:50Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Post date:** [July 22, 2020, 11:09am UTC](https://discourse.julialang.org/t/element-wise-exponentiation/43480/10 "2020-07-22T11:09:31Z")

</div>

This was already discussed [here](https://discourse.julialang.org/t/repl-domain-error-for-exponentiation/31408), 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.

---

_[View the full topic](https://discourse.julialang.org/t/element-wise-exponentiation/43480)._
