// Token: 0x0600008C RID: 140 RVA: 0x00003B34 File Offset: 0x00001D34 public override void Int64(long val) { Union64 u = default(Union64); u.i = val; this.Write64(u); }
// Token: 0x0600008F RID: 143 RVA: 0x00003B90 File Offset: 0x00001D90 public override void Double(double val) { Union64 u = default(Union64); u.f = val; this.Write64(u); }
/// <summary> /// Compares this MinValue to a signed int64 value. /// </summary> /// <param name="other">Int64 value to compare against.</param> /// <inheritdoc cref="CompareTo(sbyte)"/> public int CompareTo(long other) { Union64 u64 = new Union64(other); if ((tc5 & 9) == 0) // signed and NOT float/double/decimal { if (u64.int_4_7 >= 0) // other >= 0 ? { return(-1); } //else: other < 0 if (tc5 == 6) { return(other == long.MinValue ? 0 : -1); } //else: this is int/short/sbyte if (~u64.int_4_7 == 0 & u64.int_0_3 < 0) // other >= int.MinValue ? { return((int.MinValue >> 24 - (tc5 + tc5 + (tc5 & 4) << 1)) - u64.int_0_3); //(cant overflow because: other < 0) } //else: other < int.MinValue return(1); } else { return(1 - (tc5 & 9) - (u64.int_4_7 >> 31) + (unchecked (-(u64.int_4_7 | u64.ushort_0_1 | u64.ushort_2_3) & ~u64.int_4_7) >> 31)); //return 1 - (tc5 & 9) - (u64.int_4_7 >> 31) + (new Union64(unchecked(-other & ~other)).int_4_7 >> 31); } }
/// <summary> /// Compares this MaxValue to an unsigned int64 value. /// </summary> /// <param name="other">UInt64 value to compare against.</param> /// <inheritdoc cref="CompareTo(sbyte)"/> public int CompareTo(ulong other) { Union64 u64 = new Union64(other); if (u64.int_4_7 == 0) { return(CompareTo(u64.uint_0_3)); } /* * if (tc5 < 6) // more common..? * return -1; */ if (tc5 == 6) { return(~u64.int_0_3 == 0 ? unchecked (int.MaxValue - u64.int_4_7) : u64.int_4_7); } if (tc5 == 7) { u64.uint_0_3 = ~(u64.uint_4_7 & u64.uint_0_3); // will be zero if other is ulong.Max return(u64.ushort_0_1 | u64.ushort_2_3); } return(tc5 - 6); }
private void Write64(Union64 u) { long writeOffset = this.GetWriteOffset((long)8); byte[] writeBuffer = this.GetWriteBuffer(); writeBuffer[checked ((IntPtr)writeOffset)] = u.b1; writeBuffer[checked ((IntPtr)(writeOffset + (long)1))] = u.b2; writeBuffer[checked ((IntPtr)(writeOffset + (long)2))] = u.b3; writeBuffer[checked ((IntPtr)(writeOffset + (long)3))] = u.b4; writeBuffer[checked ((IntPtr)(writeOffset + (long)4))] = u.b5; writeBuffer[checked ((IntPtr)(writeOffset + (long)5))] = u.b6; writeBuffer[checked ((IntPtr)(writeOffset + (long)6))] = u.b7; writeBuffer[checked ((IntPtr)(writeOffset + (long)7))] = u.b8; }
/// <summary> /// Compares this MaxValue to a signed int64 value. /// </summary> /// <param name="other">Int64 value to compare against.</param> /// <inheritdoc cref="CompareTo(sbyte)"/> public int CompareTo(long other) { Union64 u64 = new Union64(other); if (u64.int_4_7 == 0) { return(CompareTo(u64.uint_0_3)); } if (tc5 == 6) { return(~u64.int_0_3 == 0 ? unchecked (int.MaxValue - u64.int_4_7) : u64.int_4_7); } return(tc5 - 6); }
// Token: 0x06000098 RID: 152 RVA: 0x00003CE4 File Offset: 0x00001EE4 private void Write64(Union64 u) { long writeOffset = this.GetWriteOffset(8L); byte[] expr_0F = this.GetWriteBuffer(); checked { expr_0F[(int)((IntPtr)writeOffset)] = u.b1; expr_0F[(int)((IntPtr)(unchecked (writeOffset + 1L)))] = u.b2; expr_0F[(int)((IntPtr)(unchecked (writeOffset + 2L)))] = u.b3; expr_0F[(int)((IntPtr)(unchecked (writeOffset + 3L)))] = u.b4; expr_0F[(int)((IntPtr)(unchecked (writeOffset + 4L)))] = u.b5; expr_0F[(int)((IntPtr)(unchecked (writeOffset + 5L)))] = u.b6; expr_0F[(int)((IntPtr)(unchecked (writeOffset + 6L)))] = u.b7; expr_0F[(int)((IntPtr)(unchecked (writeOffset + 7L)))] = u.b8; } }
// Token: 0x06000098 RID: 152 RVA: 0x00003CE4 File Offset: 0x00001EE4 private void Write64(Union64 u) { var writeOffset = GetWriteOffset(8L); var expr_0F = GetWriteBuffer(); checked { expr_0F[(int)(IntPtr)writeOffset] = u.b1; expr_0F[(int)(IntPtr) unchecked (writeOffset + 1L)] = u.b2; expr_0F[(int)(IntPtr) unchecked (writeOffset + 2L)] = u.b3; expr_0F[(int)(IntPtr) unchecked (writeOffset + 3L)] = u.b4; expr_0F[(int)(IntPtr) unchecked (writeOffset + 4L)] = u.b5; expr_0F[(int)(IntPtr) unchecked (writeOffset + 5L)] = u.b6; expr_0F[(int)(IntPtr) unchecked (writeOffset + 6L)] = u.b7; expr_0F[(int)(IntPtr) unchecked (writeOffset + 7L)] = u.b8; } }
public static uint Compute32(uint crc, ulong u) { Union64 union64 = new Union64() { u = u }; CRC.byteBuffer[0] = union64.b1; CRC.byteBuffer[1] = union64.b2; CRC.byteBuffer[2] = union64.b3; CRC.byteBuffer[3] = union64.b4; CRC.byteBuffer[4] = union64.b5; CRC.byteBuffer[5] = union64.b6; CRC.byteBuffer[6] = union64.b7; CRC.byteBuffer[7] = union64.b8; return(CRC.CRC32(crc, CRC.byteBuffer, (ulong)8)); }
public static ulong Compute64(ulong crc, double f) { Union64 union64 = new Union64() { f = f }; CRC.byteBuffer[0] = union64.b1; CRC.byteBuffer[1] = union64.b2; CRC.byteBuffer[2] = union64.b3; CRC.byteBuffer[3] = union64.b4; CRC.byteBuffer[4] = union64.b5; CRC.byteBuffer[5] = union64.b6; CRC.byteBuffer[6] = union64.b7; CRC.byteBuffer[7] = union64.b8; return(CRC.CRC64(crc, CRC.byteBuffer, (ulong)8)); }
/// <summary> /// Compares this MinValue to an unsigned int64 value. /// </summary> /// <param name="other">UInt64 value to compare against.</param> /// <inheritdoc cref="CompareTo(sbyte)"/> public int CompareTo(ulong other) { var u64 = new Union64(other); return(CompareTo(u64.uint_0_3 | u64.uint_4_7)); // because it's either zero or not. }