English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Biblioteca estándar <math.h> en C
La función ceil(x) devuelve el valor entero más pequeño o igual que x.
double ceil(double arg);
La función ceil() toma un solo parámetro y devuelve un valor de tipo int.
Por ejemplo:Si se pasa2.3Pasado a ceil(), que devolverá3.
La función está en<math.h>Definido en el archivo de encabezado.
long double ceill(long double arg); float ceilf(float arg);
Para encontrar ceil() de long double o float, se puede usar el prototipo anterior.
#include <stdio.h> #include <math.h> int main() { double num = 8.33; int result; result = ceil(num); printf(" %.2f "Valor entero mínimo = %d", num, result); return 0; }
Resultados de salida
8.33 Valor entero mínimo = 9