Reputation: 349
I am confused how this works
> -2.2^(1-2.2)
[1] -0.3882333
But this does not
> x= -2.2
> x^(1+x)
[1] NaN
Upvotes: 0
Views: 443
Reputation: 1199
Yes. Use complex: `
z <- complex(real = x, imaginary = y)
z
# [1] 1+1i
`
Source: http://www.johnmyleswhite.com/notebook/2009/12/18/using-complex-numbers-in-r/
Upvotes: 4