# Is cis returning correct results?

**URL:** <https://discourse.julialang.org/t/is-cis-returning-correct-results/86641>\
**Category:** General Usage\
**Created:** [September 1, 2022, 1:20pm UTC](https://discourse.julialang.org/t/is-cis-returning-correct-results/86641 "2022-09-01T13:20:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nandoconde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nandoconde/32/19497_2.png) [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Post date:** [September 1, 2022, 1:20pm UTC](https://discourse.julialang.org/t/is-cis-returning-correct-results/86641/1 "2022-09-01T13:20:17Z")

</div>

Maybe I am doing something wrong in my reasoning, but analytically

```julia
cis(x*y) == cis(x)^y

```

In code:

```julia
julia> # Using Float
julia> cis(5e7 * 2.0)
-0.3633850893556905 + 0.931639027109726im
julia> cis(5e7) ^ 2.0
-0.3633850893556906 + 0.9316390271097259im
julia> cis(5e7 * 2.1)
0.9880309286897708 + 0.15425590410881812im
julia> cis(5e7) ^ 2.1
-0.45202443071289305 + 0.8920055571792617im

# Using BigFloat
julia> cis(big"5e7" * big"2.1")
0.9880309286897708804616997563820610254357463259617987003319908268170075919850126 + 0.1542559041088181145159740301064797893361917687791464001837337459216975916488799im
julia> cis(big"5e7") ^ big"2.1"
-0.4520244307128928296616540228665411884609079531692781788401347090979223668926859 + 0.8920055571792617198358196686276885749193557554735942508409861455486149644639732im

```

Am I doing something wrong?

Thanks!

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [September 1, 2022, 1:30pm UTC](https://discourse.julialang.org/t/is-cis-returning-correct-results/86641/2 "2022-09-01T13:30:37Z")

</div>

Are you sure `cis(x*y) == cis(x)^y`? These types of rules often don’t work since they depend on which branch of the complex logarithm you take.

---

<div class="post-metadata">

**Author:** ![nandoconde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nandoconde/32/19497_2.png) [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Post date:** [September 1, 2022, 1:45pm UTC](https://discourse.julialang.org/t/is-cis-returning-correct-results/86641/3 "2022-09-01T13:45:37Z")

</div>

You are right, and I am sorry! It seems it does not hold for non-integers.

---

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [September 1, 2022, 2:03pm UTC](https://discourse.julialang.org/t/is-cis-returning-correct-results/86641/4 "2022-09-01T14:03:44Z")

</div>

I think exponent rules still apply to non-integer exponents if the base is a positive real number. Definitely not complex numbers in general e.g. (i^4)^0.5 = 1^0.5 = 1 != i^(4\*0.5) = i^2 = -1. Hard to actually track down a clear summary extending the exponent rules beyond integer exponents.
