/// <summary> /// Compares the current object with another object of the same type. /// </summary> /// <returns> /// A value that indicates the relative order of the objects being compared. /// The return value has the following meanings: /// Less than zero - This object is less than the <paramref name="other"/>. /// parameter.Zero - This object is equal to <paramref name="other"/>. /// Greater than zero - This object is greater than <paramref name="other"/>. /// </returns> /// <param name="other">An object to compare with this object.</param> public int CompareTo(UInt128 other) { if (MostSignificant != other.MostSignificant) { return(MostSignificant.CompareTo(other.MostSignificant)); } return(LeastSignificant.CompareTo(other.LeastSignificant)); }
/// <summary> /// Returns the hash code for this instance. /// </summary> /// <returns> /// A 32-bit signed integer that is the hash code for this instance. /// </returns> /// <filterpriority>2</filterpriority> public override int GetHashCode() { return(MostSignificant.GetHashCode() + LeastSignificant.GetHashCode()); }