Java Double Number mod Modulo(double x, double y)

Here you can find the source of Modulo(double x, double y)

Description

Modulo function

License

Open Source License

Return

the Modulo

Declaration

public static double Modulo(double x, double y) 

Method Source Code

//package com.java2s;

public class Main {
    /** Modulo function/*from w w w.  j  a v  a  2 s. co m*/
     * @return the Modulo
     */
    public static double Modulo(double x, double y) {
        return y * Frac(x / y);
    }

    /** Fractional part of a number (y=x-[x])
     * @return fractional part of a number
     */
    public static double Frac(double x) {
        return x - Math.floor(x);
    }
}

Related

  1. modArray(double value, int mod, int div)
  2. modifiedGramSchmidt(double[][] s)
  3. modifiedJulianToJulian(double modifiedJulian)
  4. modifySize(double[] x, int newLen)
  5. modPI2(double angle)
  6. modulo10(double d, boolean round)
  7. moduloAngle(double angle)
  8. moduloTwoPI(double x)
  9. modValue(double v, int precision)