4 ms·
Isn't that true for all correct implementations of negative zero? It's still a neutral for addition
by kzemek 6y ago
Isn't that true for all correct implementations of negative zero? It's still a neutral for addition
- worc3131 6y agoNot quite neutral. You return -0.0 only when needed. >>> 0.0+0.0 0.0 >>> 0.0+(-0.0) 0.0 >>> (-0.0)+0.0 0.0 >>> (-0.0)+(-0.0) -0.0
- thaumasiotes 6y ago> Not quite neutral. Hmm? Your examples show -0.0 being additively neutral in every case. +0.0 is the one that behaves weirdly.
- shultays 6y agoheh, looks like abs(-0.0) is slightly less than abs(+0.0)!