C언어 floor()

Jmnote bot (토론 | 기여)님의 2020년 11월 2일 (월) 02:40 판 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

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 }}