Java floor floor(double a)

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

Description

Returns the largest (closest to positive infinity) double value that is less 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 largest (closest to positive infinity) floating-point value that less than or equal to the argument and is equal to a mathematical integer

Declaration

public static double floor(double a) 

Method Source Code

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

public class Main {
    /**/*from  w ww. j a  va2 s .  co m*/
     * Returns the largest (closest to positive infinity) {@code double} value
     * that is less 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.</ul>
     *
     * @param a a value
     * @return the largest (closest to positive infinity) floating-point value
     * that less than or equal to the argument and is equal to a mathematical
     * integer
     */
    public static double floor(double a) {
        return Math.floor(a);
    }
}

Related

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