Skip to content

Commit 8d6f29b

Browse files
committed
[C#] Compare PrimitiveValue with doubles in the same way as Java by the raw bits, so NaN and Infinity are correctly handled.
1 parent a1ea4e8 commit 8d6f29b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

csharp/sbe-dll/PrimitiveValue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ public override bool Equals(object value)
501501

502502
case Representation.Double:
503503
{
504-
return _doubleValue.Equals(rhs._doubleValue);
504+
return BitConverter.DoubleToInt64Bits(_doubleValue) == BitConverter.DoubleToInt64Bits(rhs._doubleValue);
505505
}
506506

507507
case Representation.ByteArray:

0 commit comments

Comments
 (0)