Java Long Number Mod mod(long pNum, long pDivisor)

Here you can find the source of mod(long pNum, long pDivisor)

Description

mod

License

Open Source License

Declaration

public static long mod(long pNum, long pDivisor) 

Method Source Code

//package com.java2s;

public class Main {
    public static long mod(long pNum, long pDivisor) {
        long divisor = Math.abs(pDivisor);
        return (pNum % divisor + divisor) % divisor;
    }//from   ww  w.  j  av  a2 s. c  om

    public static int mod(int pNum, int pDivisor) {
        int divisor = Math.abs(pDivisor);
        return (pNum % divisor + divisor) % divisor;
    }

    public static float mod(float pNum, float pDivisor) {
        return ((pNum % pDivisor) + pDivisor) % pDivisor;
    }
}

Related

  1. mod(long a, long b)
  2. mod(long v, long m)
  3. mod(long x, long y)
  4. modDivide(long a, long b, long m)
  5. modifiedCalcElementOffset(long index, long mask)