Here you can find the source of ceilingAbs(double a)
public static int ceilingAbs(double a)
//package com.java2s; //License from project: GNU General Public License public class Main { /** Returns ceiling for absolute value of a, keeping the sign. */ public static int ceilingAbs(double a) { int ceil = (int) a; if (a >= 0) { return a > (double) ceil ? ceil + 1 : ceil; } else {//from ww w . ja v a2 s . c om return a < (double) ceil ? ceil - 1 : ceil; } } }