Class ULongExtensions
- Namespace
- FishMMO.Shared
- Assembly
- FishMMO-SharedUtility.dll
Provides deterministic unsigned 64-bit integer utility methods for the FishMMO framework. All calculations use pure integer math to ensure cross-platform consistency.
public static class ULongExtensions
- Inheritance
-
ULongExtensions
- Inherited Members
Methods
AbsoluteSubtract(ulong, ulong)
Returns the absolute difference between two unsigned 64-bit values. Prevents underflow by checking which value is larger before subtraction.
public static ulong AbsoluteSubtract(this ulong number, ulong other)
Parameters
Returns
Clamp(ulong, ulong, ulong)
Returns the value clamped to the specified inclusive minimum and maximum range.
public static ulong Clamp(this ulong number, ulong minimum, ulong maximum)
Parameters
Returns
DigitCount(ulong)
Returns the total count of digits in the unsigned 64-bit value using deterministic range checks.
public static int DigitCount(this ulong number)
Parameters
numberulong
Returns
GetDigit(ulong, int)
Returns the specific digit at the given index, where 0 is the least significant digit (ones place).
public static ulong GetDigit(this ulong number, int digitIndex)
Parameters
Returns
GetPercentOf(ulong, ulong)
Calculates a percentage of an unsigned 64-bit number using integer math with rounding. Formula: (number * percent + 50) / 100
public static ulong GetPercentOf(this ulong number, ulong percent)