Name

floor()

Description

Calculates the closest int value that is less than or equal to the value of the parameter.

Examples

  • float x = 2.88;  
    int a = floor(x);  // Sets 'a' to 2
    

Syntax

  • floor(n)

Parameters

  • n(float)number to round down

Return

  • int