Table of Contents

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

number ulong
other ulong

Returns

ulong

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

number ulong
minimum ulong
maximum ulong

Returns

ulong

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

number ulong

Returns

int

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

number ulong
digitIndex int

Returns

ulong

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)

Parameters

number ulong
percent ulong

Returns

ulong