Here you can find the source of mod(double m, double n)
Parameter | Description |
---|---|
m | a parameter |
n | a parameter |
public static double mod(double m, double n)
//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; } }