"C언어 floor()"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
 
(사용자 2명의 중간 판 4개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
;C언어 floor()
;C언어 floor()
;C Language floor()
;C Language floor()  
*소수점 이하 버림
*소수점 이하 버림 (Round down value)
*헤더: [[math.h]]


==문법==
{{소스헤더|정의}}
*헤더
<syntaxhighlight lang='C'>
<source lang='C'>
math.h
</source>
*정의
<source lang='C'>
double floor (double x);
double floor (double x);
</source>
</syntaxhighlight>


==예시==
==예시==
<source lang='console'>
<syntaxhighlight lang='c'>
#include <stdio.h>
#include <stdio.h>
#include <math.h>
#include <math.h>
26번째 줄: 22번째 줄:
     return 0;
     return 0;
}
}
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==
* [[C언어 강좌]]
* [[C언어 강좌]]
* [[C언어 ceil()]]
* [[C언어 ceil()]]
* [[C언어fabs()]]
* [[C언어 fabs()]]
* [[C++ floor()]]
* [[함수 floor()]]


[[분류:C]]
[[분류: C]]
[[분류:반올림]]
[[분류: math.h]]

2020년 11월 2일 (월) 02:40 기준 최신판

1 개요[ | ]

C언어 floor()
C Language floor()
  • 소수점 이하 버림 (Round down value)
  • 헤더: math.h
정의
double floor (double x);

2 예시[ | ]

#include <stdio.h>
#include <math.h>

int main()
{
    printf("2.4 → %.1lf\n", floor(2.4)); // 2.4 → 2.0
    printf("3.7 → %.1lf\n", floor(3.7)); // 3.7 → 3.0

    return 0;
}

3 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}