Here you can find the source of ceil(double x, double y)
public static double ceil(double x, double y)
//package com.java2s; public class Main { /**//from w ww . j ava2s. co m * Truncate x up to the nearest y. */ public static double ceil(double x, double y) { return y * Math.ceil((x + .00001) / y); } }