|
라이손레종ㅎ 님이 쓰신 글 :
: 안녕하세요 ?
: 초보적인 질문입니다 ^^; 오래된 gw basic소스를 변환 중인데요.. 혼자 공부하는중이라 어렵네요..
:
: GW-BASIC - INT(X) : X보다 크지 않은 정수값.
: 이렇게 인터넷에 나와 있던데..
:
: c언어로는 어떤 함수와 같은지요.. ?
:
: 송구스럽지만.. 답변 좀 부탁드리겠습니다.
Header File
math.h
Prototype
double floor(double x);
Description
Rounds down.
floor finds the largest integer not greater than x.
예:
#include<math.h >
int i = floor(123.56);
int j = floor(-123.56);
또는
double x = 123.56;
//double x = -123.56;
int i;
if(x>=0.0) i = x;
else i = x-1;
|