Here you can find the source of ceil(float x)
public static int ceil(float x)
//package com.java2s; //License from project: Open Source License public class Main { public static int ceil(float x) { int res = (int) x; if (res == x) { return res; } else if (x >= 0) { return res + 1; } else {//from www. jav a 2s.com return res - 1; } } }