Here you can find the source of floor(double a)
Parameter | Description |
---|---|
a | a value |
public static double floor(double a)
//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); } }