Here you can find the source of ceil(double num, int bit)
public static double ceil(double num, int bit)
//package com.java2s; //License from project: Open Source License public class Main { public static double ceil(double num, int bit) { int t = 1; for (int i = 0; i < bit; i++) t *= 10;//from ww w . j a v a2 s . c om int n = (int) (num * t) + 1; return (double) n / t; } public static double ceil(double num) { return ceil(num, 0); } }