C Tutorial/math.h/ceil

Материал из C\C++ эксперт
Перейти к: навигация, поиск

ceil

Item Value Header file math.h Declaration float ceilf(float num);double ceil(double num);long double ceill(long double num); Return returns the smallest integer not less than num.

  1. Given 1.02, ceil() would return 2.0.
  2. Given -1.02, ceil() would return -1.


<source lang="cpp">#include <math.h>

 #include <stdio.h>
 int main(void)
 {
   printf("%f", ceil(9.9));
  
 }</source>