floor
uint8_t floor(uint8_t x)int8 floor(int8 x)
int floor(int x)
float floor(float x)
Description
Returns the largest integer value not greater than x (round towards negative infinity).
For integer types the value is returned unchanged.
The return type matches the input type.
Parameter
- x - A numeric value (uint8_t, int8, int or float).
Returns
The floor of x, with the same type as the input.
Example
void main()
{
float a = floor(3.9); // a = 3.0
float b = floor(-1.2); // b = -2.0
int c = floor(5); // c = 5
}