public void ChoppedDoubleIsValidDecimalRK() { double dbl = 123.4567; Bytes bytes = new Bytes(BitConverter.GetBytes(dbl)); Bytes.Bits bits = bytes.GetBits(); Bytes.Bits mostSigBits = bits.Get(34, 30); double newDbl = mostSigBits.ToDouble(); Assert.AreEqual(dbl, newDbl, 0.001, "Values are too different"); }
public void DoubleIsLittleEndian() { double dbl = 123.4567; Bytes bytes = new Bytes(BitConverter.GetBytes(dbl)); Bytes.Bits bits = bytes.GetBits(); Bytes.Bits mostSigBits = bits.Get(2, 62); double newDbl = mostSigBits.ToDouble(); Assert.AreEqual(dbl, newDbl, 0.000001, "Values are different"); }