# Question about \`exp\` with imaginary argument

**URL:** <https://discourse.julialang.org/t/question-about-exp-with-imaginary-argument/136773>\
**Category:** General Usage\
**Created:** [April 19, 2026, 9:26am UTC](https://discourse.julialang.org/t/question-about-exp-with-imaginary-argument/136773 "2026-04-19T09:26:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![aitzkora](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aitzkora/32/14610_2.png) [@aitzkora](https://discourse.julialang.org/u/aitzkora)\
**Post date:** [April 19, 2026, 9:26am UTC](https://discourse.julialang.org/t/question-about-exp-with-imaginary-argument/136773/1 "2026-04-19T09:26:25Z")

</div>

I do not understand the result in the second case

```julia-auto
julia> exp(2π/3 * 1im)
-0.4999999999999998 + 0.8660254037844387im
julia> exp(2π/3im)
-0.4999999999999998 - 0.8660254037844387im
julia> cis(2π/3)
-0.4999999999999998 + 0.8660254037844387im

```

Why there is a minus sign for the imag part ? 🤔

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [April 19, 2026, 9:33am UTC](https://discourse.julialang.org/t/question-about-exp-with-imaginary-argument/136773/2 "2026-04-19T09:33:22Z")

</div>

This has nothing to do with `exp`, but with what you’re passing as argument:

```julia-auto
julia> 2π/3im
0.0 - 2.0943951023931953im

julia> 2π/3 * im
0.0 + 2.0943951023931953im

```

juxtaposition has higher precedence than `/`, `2π/3im` is `(2 * π) / (3 * im)`, not `(2 * π / 3) * im`. My perhaps controversial suggestion is to avoid it if you don’t want surprises, as cute as it is.

---

<div class="post-metadata">

**Author:** ![aitzkora](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aitzkora/32/14610_2.png) [@aitzkora](https://discourse.julialang.org/u/aitzkora)\
**Post date:** [April 19, 2026, 9:41am UTC](https://discourse.julialang.org/t/question-about-exp-with-imaginary-argument/136773/3 "2026-04-19T09:41:45Z")

</div>

thanks!

---

<div class="post-metadata">

**Author:** ![Boris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/boris/32/3306_2.png) [@Boris](https://discourse.julialang.org/u/Boris)\
**Post date:** [April 20, 2026, 11:05am UTC](https://discourse.julialang.org/t/question-about-exp-with-imaginary-argument/136773/4 "2026-04-20T11:05:09Z")

</div>

That is exactly the reason why I never do `2x`. Yes, I know it looks neat and there are many topics discussing this and I know that the core julia devs like/love this feature and defend it, but I make enough confusion in my code on my own, don’t need help from outside 😃

---

<div class="post-metadata">

**Author:** ![lilachint](https://avatars.discourse-cdn.com/v4/letter/l/ee7513/32.png) [@lilachint](https://discourse.julialang.org/u/lilachint)\
**Post date:** [April 20, 2026, 11:09am UTC](https://discourse.julialang.org/t/question-about-exp-with-imaginary-argument/136773/5 "2026-04-20T11:09:29Z")

</div>

Fair enough, being consistent is key.

---

<div class="post-metadata">

**Author:** ![lilachint](https://avatars.discourse-cdn.com/v4/letter/l/ee7513/32.png) [@lilachint](https://discourse.julialang.org/u/lilachint)\
**Post date:** [April 21, 2026, 2:09am UTC](https://discourse.julialang.org/t/question-about-exp-with-imaginary-argument/136773/6 "2026-04-21T02:09:01Z")

</div>

Would it be a good idea to make the precendence of implicit multiplication lower than most explicit operators? That should be more intuitive. E.g. `1/2e` would be `1/(2e)` instead of `(1/2)e`? I’m not sure of the implementation difficulty though.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [April 21, 2026, 5:23am UTC](https://discourse.julialang.org/t/question-about-exp-with-imaginary-argument/136773/7 "2026-04-21T05:23:03Z")

</div>

Isn’t the whole point of this thread that `1/2e` is `1/(2e)`?

---

<div class="post-metadata">

**Author:** ![Sevi](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@Sevi](https://discourse.julialang.org/u/Sevi)\
**Post date:** [April 21, 2026, 7:27am UTC](https://discourse.julialang.org/t/question-about-exp-with-imaginary-argument/136773/8 "2026-04-21T07:27:15Z")

</div>

As others have mentioned, it’s debatable whether the current behavior of juxtaposition was a good choice or not. But even if most people were to agree that a different behavior would be better, it would break a lot of existing code. So realistically, it’s not going to be changed.

This is an older post, sir, but it checks out:

> [@PSA: Julia is not at that stage of development anymore](https://discourse.julialang.org/t/psa-julia-is-not-at-that-stage-of-development-anymore/44872):
>
> You heard about this brand new exciting programming language called Julia and have some suggestions for how it should work. Wonderful! We’re happy to have you here and help you learn the language and listen to your ideas! However, please be aware that “new” is a relative term. Yes, Julia is newer than, say, C, which was first created in 1972 and standardized in 1989. It is not, however, new in the sense that it is still being freely designed and changed in arbitrary ways. Julia development start…

---

<div class="post-metadata">

**Author:** ![lilachint](https://avatars.discourse-cdn.com/v4/letter/l/ee7513/32.png) [@lilachint](https://discourse.julialang.org/u/lilachint)\
**Post date:** [April 21, 2026, 7:36am UTC](https://discourse.julialang.org/t/question-about-exp-with-imaginary-argument/136773/9 "2026-04-21T07:36:08Z")

</div>

Realisticly yes, that’s very true. I still have some hope that maybe a certain major version would allow breaking changes, somehow still supporting old code, although chances are extremely slim. Even that post is from 6 years ago… It’s a bit sad.
