Browse Source

Add comment for Double_One_Div_LongMaxValue

pull/2626/head
Daniel Grunwald 4 years ago
parent
commit
7a97fdd02d
  1. 6
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/WellKnownConstants.cs

6
ICSharpCode.Decompiler.Tests/TestCases/Pretty/WellKnownConstants.cs

@ -46,8 +46,12 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -46,8 +46,12 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public const long LongMaxValue = long.MaxValue;
public const long LongMinValue = long.MinValue;
// This constant is (1 / (double)long.MaxValue). Note that the (double) cast involves
// loss of precision: long.MaxValue is rounded up to (long.MaxValue+1), which is a power of two.
// The division then is exact, resulting in the double 0x3c00000000000000.
// When trying to represent this as a fraction, we get (long.MaxValue+1) as divisor, which
// does not fit type long, but compares equals to long.MaxValue due to the long->double conversion.
public const double Double_One_Div_LongMaxValue = 1.0842021724855044E-19;
public const double Double_One_Div_LongMaxValue_NextDouble = 1.0842021724855047E-19;
public const float FloatZero = 0f;
public const float FloatMinusZero = -0f;

Loading…
Cancel
Save