/// <summary> /// Reads a value from the packet /// </summary> /// <returns>value</returns> public double ReadDouble() { double res = ByteManipulator.ReadDouble(Data, CurrentSeek); CurrentSeek += sizeof(double); return(res); }
public void TestListDoubleReadRedLight() { List <byte> arr = new List <byte>(sizeof(double)); for (int i = 0; i < sizeof(double); i++) { arr.Add(0); } ByteManipulator.Write(arr, 0, 10d); Assert.That(ByteManipulator.ReadDouble(arr, 0), Is.Not.EqualTo(9d)); }
public void TestDoubleReadRedLight() { byte[] arr = new byte[sizeof(double)]; ByteManipulator.Write(arr, 0, 1000000d); Assert.That(ByteManipulator.ReadDouble(arr, 0), Is.Not.EqualTo(0d)); }
public void TestDoubleRead() { byte[] arr = new byte[sizeof(double)]; ByteManipulator.Write(arr, 0, 1000.251d); Assert.That(ByteManipulator.ReadDouble(arr, 0), Is.EqualTo(1000.251d)); }