floor

Returns the whole number less than or equal to its argument.

Example

Find the largest integer that is less than or equal to 5.9.

floor(5.9)

Syntax

floor(double expr x)
  • x : expression returning double

    Returns

    int

Notes

Function floor evaluates its argument and finds the largest integer that is less than the argument.