Interface BaseNCodec.CustomDivider

  • Enclosing class:
    BaseNCodec
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public static interface BaseNCodec.CustomDivider
    A division function that returns quotient and remainder.

    It MUST perform SIGNED long division.

    Example:

    
     
     CustomDivider divideBy64 = x -> new long[] { x / 64, x % 64 };
     
     long[] answer = divideBy64(1024);
     
     
    • Method Detail

      • divide

        long[] divide​(long x)
        Divide a number by x. Returned pair of longs: [x / divider, x % divider]
        Parameters:
        x - the divisor
        Returns:
        a pair of longs