Method AbsDistance
AbsDistance(ushort, ushort)
Calculate the difference between two sequence IDs, taking integer overflow/underflow into account. For example, both AbsDistance(65535, 0) and AbsDistance(0, 65535) will return 1, not 65535.
Declaration
public static int AbsDistance(ushort lhs, ushort rhs)
Parameters
Type | Name | Description |
---|---|---|
ushort | lhs | The first sequence ID. Compared against the second. |
ushort | rhs | The second sequence ID. Compared against the first. |
Returns
Type | Description |
---|---|
int | An integer value equal to the distance between the sequence IDs. |