• Applies a modulo but forces the result to be positive.

    Parameters

    • number: number

      The number to apply the modulo to.

    • modulo: number

      The modulo to apply.

    Returns number

    The result of the modulo.

    twoWayModulo(-5, 10); // 5
    twoWayModulo(5, 10); // 5
    twoWayModulo(15, 10); // 5
    twoWayModulo(7, 10); // 7
    twoWayModulo(-7, 10); // 3
    twoWayModulo(17, 10); // 7
    twoWayModulo(-17, 10); // 3