名前


trunc, truncf, truncl - 0 に近い方の整数値に丸める

書式


#include <math.h>

double trunc(double x); float truncf(float x); long double truncl(long double x);

-std=c99 でコンパイルし、-lm でリンクする。

説明


これらの関数は絶対値が x より小さい方の 一番近い整数値に x を丸める。

返り値


丸めた整数値。 x が整数・無限・NaN の場合、x 自身が返される。

エラー


なし。

準拠


C99.

関連項目


ceil(3), floor(3), lrint(3), nearbyint(3), rint(3), round(3)

openSUSE Logo

コンテンツ