ceil
uint8_t ceil(uint8_t x)int8 ceil(int8 x)
int ceil(int x)
float ceil(float x)
Description
Returns the smallest integer value not less than x (round towards positive 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 ceiling of x, with the same type as the input.
Example
void main()
{
float a = ceil(3.1); // a = 4.0
float b = ceil(-1.8); // b = -1.0
int c = ceil(5); // c = 5
}