Here you can find the source of ceil(double d)
public static final int ceil(double d)
//package com.java2s; // {LICENSE}/*w ww.j av a2s . c o m*/ public class Main { private static final int INT = 16384; private static final double CEIL = INT + 0.9999; public static final int ceil(double d) { return (int) (d + CEIL) - INT; } }