lround, lroundf, lroundl, llround, llroundf, llroundl
lround, lroundf, lroundl, llround, llroundf, llroundl
헤더 파일
[언어 자료구조 알고리즘/C11 표준 라이브러리 함수] - math.h
long int lround(double x); 반올림, lrint와 같음
long int lroundf(float x); 반올림, lrintf와 같음
long int lroundl(long double x); 반올림, lrintl과 같음
long long int llround(double x); 반올림, llrint와 같음
long long int llroundf(float x); 반올림, llrintf와 같음
long long int llroundl(long double x); 반올림, llrintl과 같음
입력 매개 변수 리스트
x 실수
반환 값
x를 반올림한 값
사용 예
//C언어 표준 라이브러리 함수 가이드
//long int lround(double x); 반올림, lrint와 같음
//long int lroundf(float x); 반올림, lrintf와 같음
//long int lroundl(long double x); 반올림, lrintl과 같음
//long long int llround(double x); 반올림, llrint와 같음
//long long int llroundf(float x); 반올림, llrintf와 같음
//long long int llroundl(long double x); 반올림, llrintl과 같음
#include <math.h>
#include <stdio.h>
int main(void)
{
printf("%d\n", lround(1.4));
printf("%d\n", lround(1.5));
printf("%lld\n", llround(1234567890123.1));
return 0;
}
출력
1
2
1234567890123
사용한 함수
[언어 자료구조 알고리즘/C11 표준 라이브러리 함수] - printf
관련 함수
[언어 자료구조 알고리즘/C11 표준 라이브러리 함수] - lrint, lrintf, lrintl, llrint, llrintf, llrintl