I'm a beginner at Julia and am using it to compute the power of a complex number as a subroutine in a larger scientific task where I run
array = [1im^(i-j) for i in 1:5, j in 1:5]
but I get the following DomainError :
DomainError with -1:
Cannot raise an integer x to a negative power -1.
Convert input to float.
Particularly, when I run the for loop and print the value for each (i,j), the same error occurs at (i=2,j=1). I'll be very grateful if someone can help me with this. What seems to be wrong with my code? How can I overcome this error?
Thank you in advance.