Here you can find the source of ceil(double x)
Parameter | Description |
---|---|
x | The double to round |
public static int ceil(double x)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w ww . j a va 2s . c o m * Rounds up a double to an int * @param x The double to round * @return Rounded int */ public static int ceil(double x) { int xi = (int) x; return x > xi ? xi + 1 : xi; } }