如何解析C#string
“ - 0”到长值 -9223372036854775808 (十六进制: 0x8000000000000000 )?< / p>
以下代码显示值不相等。
double negativeZero = -0.0;
long negativeZeroLong = BitConverter.DoubleToInt64Bits(negativeZero); // 0x8000000000000000
long parsedNegativeZeroLong = BitConverter.DoubleToInt64Bits(System.Double.Parse("-0.0", System.Globalization.NumberStyles.Float)); //0
Console.WriteLine("{0} != {1}", negativeZeroLong.ToString("X"), parsedNegativeZeroLong.ToString("X")); //8000000000000000 != 0