ceil()

Rounds up to an integer.

Synopsis

float ceil(float x);

Parameters

Parameter Description
x value

Return Value

In the event of an error, 0.0 is returned.

Description

Returns the smallest integer that is greater than or equal to x as the float value.

Example

main()
{
  int i;
  i = ceil(0.4);
// results in 1
  i = ceil(1.9);

// results in 2
}

Assignment

Mathematical function

Availability

CTRL