Java Ceil ceil(double x)

Here you can find the source of ceil(double x)

Description

Rounds up a double to an int

License

Open Source License

Parameter

Parameter Description
x The double to round

Return

Rounded int

Declaration

public static int ceil(double x) 

Method Source Code

//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;
    }
}

Related

  1. ceil(double double1, double double2)
  2. ceil(double num, int bit)
  3. ceil(double value, int decimal)
  4. ceil(double value, int scale)
  5. ceil(double Var1)
  6. ceil(double x)
  7. ceil(double x, double y)
  8. ceil(double[] array)
  9. ceil(final double num)