public void ValueDoubleUInt64Test(double realValue, UInt64 fixedPointValue, byte wholeBits, byte fractionalBits) { // The fixedPointValue may have additional bits set which should be ignored when making the real value. Only the // bits that make up the whole and fractional parts are considered. // fixedPointValue.MakeDouble(wholeBits, fractionalBits).ShouldBe(realValue, Double.Epsilon); // Some of our test cases pass in "extra" data in the fixed point value. This data is ignored, but it means those // bits will be 0 when converting from the real value to the FixedPoint so make the value we check again is properly // masked from the test data. // UInt64 maskedFixedPointValue = (UInt64)(fixedPointValue & (UInt64)FixedPoint.FixedPointMask(wholeBits, fractionalBits)); realValue.MakeFixedPoint <UInt64>(wholeBits, fractionalBits).ShouldBe(maskedFixedPointValue); }