Java Integer Mod ModEuclidean(int D, int d)

Here you can find the source of ModEuclidean(int D, int d)

Description

Mod Euclidean

License

Apache License

Declaration

public static int ModEuclidean(int D, int d) 

Method Source Code

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

public class Main {
    public static int ModEuclidean(int D, int d) {
        int r = D % d;
        if (r < 0) {
            if (d > 0) {
                r = r + d;//from  ww w. j ava 2 s. c om
            } else {

                r = r - d;
            }
        }
        return r;
    }
}

Related

  1. mod4(int a)
  2. mod_diff(int x, int y, int R)
  3. modByPowerOfTwo(int value, int mod)
  4. modCeil(int x, int mod)
  5. mode(final StringBuilder buffer, final int mode)
  6. modifyAlpha(int color, int alpha)
  7. modifyBase32AtIndex(final String s, final int index)
  8. modifyDummyString(String dummyString, int beginTag, int endTag)
  9. modifyPublicPortCheckRange(String modifiedVal, int dashCnt)