public static int operator -(SequenceId a, SequenceId b) { int difference = SequenceId.GetDifference(a, b) >> SequenceId.BIT_SHIFT; // We need to skip 0 since it's not a valid number if (a.rawValue < b.rawValue) { if (difference > 0) { difference--; } } else { if (difference < 0) { difference++; } } return(difference); }
public static bool operator <=(SequenceId a, SequenceId b) { int difference = SequenceId.GetDifference(a, b); return(difference <= 0); }