Keil Logo

ceil

Summary
#include <math.h>

double ceil (
  double val);   /* number to calculate ceiling for */
Description

The ceil function calculates the smallest integer value that is greater than or equal to val.

Return Value

The ceil function returns a float that contains the smallest integer value that is not less than val.

See Also

floor

Example
#include <math.h>
#include <stdio.h> /* for printf */

void tst_ceil (void) {
  float x;
  float y;

  x = 45.998;
  y = ceil (x);

  printf ("CEIL(%f) = %f\n", x, y);

  /* output is "CEIL(45.998) = 46" */
}
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.