Class NumericUtilities
Generic utilities and extensions for strings.
Inheritance
System.Object
NumericUtilities
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: MoreStructures.Utilities
Assembly: MoreStructures.dll
Syntax
public static class NumericUtilities
Methods
| Improve this Doc View SourceMiddle((Int32 lower, Int32 higher))
Returns the middle point of the provided interval
.
Declaration
public static int Middle(this (int lower, int higher) interval)
Parameters
Type | Name | Description |
---|---|---|
System.ValueTuple<System.Int32, System.Int32> | interval | A 1D interval, identified by a lower and an upper extreme. |
Returns
Type | Description |
---|---|
System.Int32 | The middle point of the interval. |
Remarks
Uses the geometric interpretation of middle point to avoid int overflow, when the sum of the lower and the upper extremes goes above System.Int32.MaxValue or below System.Int32.MinValue.