Skip to main content

CommonModulo

Callable

  • CommonModulo(value: number, divisor: number): number

  • Return value % divisor but properly handling negative values

    Useful if you have a set of keys and want to move an index within its bounds with proper wrap-around.


    Parameters

    • value: number
    • divisor: number

    Returns number