C
round
typeConversion
#migrated

C > float型のint型へのキャスト > 少数部分の扱い

More than 1 year has passed since last update.

http://ideone.com/49B9lH

#include <stdio.h>

int main(void) {
    float a = 3.1;
    float b = 3.9;

    printf("%d\n", (int)a);
    printf("%d\n", (int)b);

    return 0;
}
結果
3
3

関連
http://www.motorwarp.com/koizumi/round_c.html