Java Integer Mod mod_diff(int x, int y, int R)

Here you can find the source of mod_diff(int x, int y, int R)

Description

modiff

License

Apache License

Declaration

static int mod_diff(int x, int y, int R) 

Method Source Code

//package com.java2s;
/*/*from w w w  . j a v a  2  s . c o  m*/
 * TLSH is provided for use under two licenses: Apache OR BSD.
 * Users may opt to use either license depending on the license
 * restictions of the systems with which they plan to integrate
 * the TLSH code.
 */

public class Main {
    static int mod_diff(int x, int y, int R) {
        int dl = 0;
        int dr = 0;
        if (y > x) {
            dl = y - x;
            dr = x + R - y;
        } else {
            dl = x - y;
            dr = y + R - x;
        }
        return (dl > dr ? dr : dl);
    }
}

Related

  1. mod(int x, int y)
  2. mod(int x, int y)
  3. mod(int[]... vectors)
  4. mod(long l, int m)
  5. mod4(int a)
  6. modByPowerOfTwo(int value, int mod)
  7. modCeil(int x, int mod)
  8. mode(final StringBuilder buffer, final int mode)
  9. ModEuclidean(int D, int d)