Why +(-1 - 1.i) return (1 +1.i)?

Adding + in front of a complex number return a new complex with a positive value of the real and imaginary part.

require "complex"
pp! +( 1 + 1.i) # => (1.0 + 1.0i)
pp! +(-1 + 1.i) # => (1.0 + 1.0i)
pp! +( 1 - 1.i) # => (1.0 + 1.0i)
pp! +(-1 - 1.i) # => (1.0 + 1.0i)

Looking at the source code, this is a feature, but why?

In Ruby, Python and C++, +(-1 - 1i) return (-1 - 1i).

It’s a bug, please report it. Thank you!

Ok, thank you for the clarification.

Because it was an instance method, I thought it was a property of complex number that I didn’t know, so I preferred to ask before opening a bug.