Here you can find the source of mod(int divisor, int dividend)
static int mod(int divisor, int dividend)
//package com.java2s; //License from project: Open Source License public class Main { static int mod(int divisor, int dividend) { return (((divisor % dividend) + dividend) % dividend); }/* ww w . ja va2 s . co m*/ }