Math.floor()

Signature

double floor (double a)

Domain

action, condition

Description

Returns the largest (closest to positive infinity) double value that is not greater than the argument and is equal to a mathematical integer. Special cases:
If the argument value is already equal to a mathematical integer, then the result is the same as the argument.
If the argument is NaN or an infinity or positive zero or negative zero, then the result is the same as the argument.

Parameters

NameTypeDescription
adoubleA value.

Returns

TypeDescription
doubleThe largest (closest to positive infinity) floating-point value that is not greater than the argument and is equal to a mathematical integer.

Cautions

none

Example


String result = String.valueOfDouble (Math.floor (2.4));

Result is: result contains: "2"