diff --git a/.gitignore b/.gitignore index ec4359b..9826e9b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ example/csharp/Example/bin example/csharp/Example/obj example/csharp/ProtoPlus/obj example/csharp/ProtoPlus/bin +api/csharp/ProtoPlus/bin +api/csharp/ProtoPlus/obj diff --git a/example/csharp/ProtoPlus/OutputStream.cs b/example/csharp/ProtoPlus/OutputStream.cs index 0d2b2af..63c3e98 100644 --- a/example/csharp/ProtoPlus/OutputStream.cs +++ b/example/csharp/ProtoPlus/OutputStream.cs @@ -273,7 +273,7 @@ public void WriteUInt64(int fieldIndex, List value) public void WriteFloat(int fieldIndex, float value) { - if (value < float.Epsilon) + if (value == 0F) { return; } @@ -307,7 +307,7 @@ public void WriteFloat(int fieldIndex, List value) public void WriteDouble(int fieldIndex, double value) { - if (value < double.Epsilon) + if (value == 0D) { return; } diff --git a/example/csharp/ProtoPlus/SizeCaculator.cs b/example/csharp/ProtoPlus/SizeCaculator.cs index 0bf14de..17a00f7 100644 --- a/example/csharp/ProtoPlus/SizeCaculator.cs +++ b/example/csharp/ProtoPlus/SizeCaculator.cs @@ -75,7 +75,7 @@ public static int SizeEnum(int fieldIndex, List value) where T : struct, I public static int SizeFloat(int fieldIndex, float value) { - if (value < float.Epsilon) + if (value == 0F) { return 0; } @@ -100,7 +100,7 @@ public static int SizeFloat(int fieldIndex, List value) public static int SizeDouble(int fieldIndex, double value) { - if (value < double.Epsilon) + if (value == 0D) { return 0; }