Java Double Number mod mod(final double a, final double b)

Here you can find the source of mod(final double a, final double b)

Description

mod

License

Apache License

Declaration

public static double mod(final double a, final double b) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static double mod(final double a, final double b) {
        double val = a;
        while (val >= b) {
            val -= b;
        }/*w  w  w  .j av a  2 s . c o m*/
        while (val < 0.0) {
            val += b;
        }
        return val;
    }
}

Related

  1. mod(double value, double mod)
  2. mod(double x, double m)
  3. mod(double x, double y)
  4. mod(double x, double y)
  5. mod(double x, double y)
  6. mod2pi(double vin)
  7. mod2pi_pos(double vin)
  8. modArray(double value, int mod, int div)
  9. modifiedGramSchmidt(double[][] s)