0

I participated discussion about complex numbers and did some experiments in Python. I do not understand this behaviour (same behavious in 2.7.2 and 3.2.2):

```
>>> -(0+1j)
(-0-1j)
>>> -(0+1j)==-1j
True
>>> -(0+1j)+0
-1j
>>> -(0+1j)-0
(-0-1j)
>>>
```

EDIT: Further investigation shows that there is -0.0 in Python, is this property of IEEE floating point arithmetic?

```
>>> -(1j)
(-0-1j)
>>> -(1j).real
-0.0
>>> -0.0
-0.0
>>> -0.0==0
True
>>> -0.0 is 0.0
False
>>> 0.0 is 0.0
True
>>> -0 is 0
True
>>>
```

And further it's id seems to change in each instance unlike 0.0:

```
>>> id(-0.0)
12428376
>>> id(0.0)
12428456
>>> id(-0.0)
12428360
>>> id(0.0)
12428456
>>>
```

*Edited 5 Years Ago by pyTony*: n/a