Recommanded Free YOUTUBE Lecture: <% selectedImage[1] %>
ceil(3)

1장. ceil(3)

차례
1.1절. 사용법
1.2절. 설명
1.3절. 반환값
1.4절. 예제

x 보다 큰 가장 작은 정수를 되돌려준다.


1.1절. 사용법

#include <math.h>

double ceil (double x);
		


1.2절. 설명

ceil() 함수는 x 보다큰 가장 작은 정수를 되돌려준다. 이를테면 올림하는 함수이다.


1.3절. 반환값

x 보다 가장 작은 double 타입의 정수


1.4절. 예제

#include <math.h>

#include <stdio.h>
#include <string.h>

int main(int argc, char **argv)
{
    double a;
    char buf[80];

    while(1)
    {
        if (fgets( buf, 79, stdin) == NULL)
            break;
        printf("%lu : %f\n", atol(buf), ceil(7.8));
    }
}