C언어 floor()

John Jeong (토론 | 기여)님의 2018년 3월 8일 (목) 00:02 판 (→‎같이 보기)

1 개요

C언어 floor()
C Language floor()
  • 소수점 이하 버림

2 문법

  • 헤더
math.h
  • 정의
double floor (double x);

3 예시

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

4 같이 보기

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