Java Ceil ceil(double a)

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

Description

Returns the smallest (closest to negative infinity) double value that is greater than or equal to the argument and is equal to a mathematical integer.

License

Open Source License

Parameter

Parameter Description
a a value

Return

the smallest (closest to negative infinity) floating-point value that is greater than or equal to the argument and is equal to a mathematical integer

Declaration

public static double ceil(double a) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*from w w  w  .java  2s . c  om*/
     * Returns the smallest (closest to negative infinity) {@code double} value
     * that is greater than or equal to the argument and is equal to a
     * mathematical integer. Special cases:
     * <ul><li>If the argument value is already equal to a mathematical integer,
     * then the result is the same as the argument. <li>If the argument is NaN
     * or an infinity or positive zero or negative zero, then the result is the
     * same as the argument. <li>If the argument value is less than zero but
     * greater than -1.0, then the result is negative zero.</ul> Note that the
     * value of {@code Math.ceil(x)} is exactly the value of
     * {@code -Math.floor(-x)}.
     *
     *
     * @param a a value
     * @return the smallest (closest to negative infinity) floating-point value
     * that is greater than or equal to the argument and is equal to a
     * mathematical integer
     */
    public static double ceil(double a) {
        return Math.ceil(a);
    }
}

Related

  1. ceil(double a, double precision)
  2. ceil(double a, int cutOfDigits)
  3. ceil(double d)
  4. ceil(double d)