|
Hello Dr OK,
Please note that this issue was addressed by the work done in CSHARP-2001.
Previous to this if the exponents differed the Decimal128 would not be considered equal, which is why you were getting a Compare() result of -1.
Closing this as a duplicate.
|
|
In my PC (2.5.0):
var a=Decimal128.Parse("10") gives _highBits=0x0x0000000000000000, _lowBits=0x000000000000000a.
var b=Decimal128.Parse("1E1") gives _highBits=0x0x0002000000000000, _lowBits=0x0000000000000001.
a.ToString() gives "10".
b.ToString() gives "1E+1".
However, Decimal.Compare(a,b) correctly returns 0. Perhaps it's fixed?
|