# Bug in iteration for complex numbers

Juan Carlos Ponce Campuzano shared this problem 2 years ago
Solved

Hello everyone,

Correct me if I am grown but I think the calculations for this applet are incorrect when z_0=i.

The values should be as follows

z_0=i

z_1=-1+i

z_2=-i

z_3=-1+i

z_4=-i

further iterations will just repeat the values -1+i and −i. But in the worksheet you can see that this is not the case and shows that the orbit is unstable, which is incorrect.

I also checked it in the desktop and online version. Both have the same issue.

I hope you can help me with this. Thanks in advance. :)

No, computers (and mathematicians!) generally do powers like this: exp(a*ln(b))

Now fixed!

1

Thanks, we'll check. for now if you change

```z^2
```

to

```z * z
```

then it will work better

1

Thanks Michael :)

1

This does fix the issue, which I find very curious. How does this change work behind the scenes? Isn't it performing the same operation?

1

No, computers (and mathematicians!) generally do powers like this: exp(a*ln(b))

Now fixed!

1

Thanks! :)