Here you can find the source of distanceAbs(final int a, final int b)
public static int distanceAbs(final int a, final int b)
//package com.java2s; //License from project: Open Source License public class Main { public static int distanceAbs(final int a, final int b) { return a > b ? a - b : b - a; }//from w w w . ja v a 2 s. c o m public static float distanceAbs(final float a, final float b) { return a > b ? a - b : b - a; } }