The MSDN documentation mentions that double
type includes negative zero. However, both -1.0 / double.PositiveInfinity
and -double.Epsilon / 2
One way is to use the BitConverter.GetBytes. If you check the bytes, you will see that the sign bit for the value is actually set indicating that its negative.
byte[] zeroBytes = BitConverter.GetBytes(zero);
byte[] negZeroBytes = BitConverter.GetBytes(negZero);
bool sameBytes = zeroBytes[7] == negZeroBytes[7];