Java Double Number mod mod(double m, double n)

Here you can find the source of mod(double m, double n)

Description

Modular arithmetic: m mod n

License

Open Source License

Parameter

Parameter Description
m a parameter
n a parameter

Return

m mod n

Declaration

public static double mod(double m, double n) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from ww  w.j av  a 2s .  c om
     * Modular arithmetic: m mod n
     * @param m
     * @param n
     * @return m mod n
     */
    public static double mod(double m, double n) {
        double result = m % n;
        return result < 0 ? result + n : result;
    }
}

Related

  1. mod(double a, double b)
  2. mod(double a, double b)
  3. Mod(double arg1, double arg2)
  4. mod(double i, final double n)
  5. mod(double left, double right)
  6. mod(double n, double d)
  7. mod(double number, double mod)
  8. mod(double value, double mod)
  9. mod(double x, double m)