名前


lrint, lrintf, lrintl, llrint, llrintf, llrintl - 最も近い整数値に丸める

書式


#include <math.h>

long int lrint(double x); long int lrintf(float x); long int lrintl(long double x);

long long int llrint(double x); long long int llrintf(float x); long long int llrintl(long double x);

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

説明


これらの関数は、現在の丸め方向を使って、最も近い整数に引き数を丸める。 x が無限または NaN の場合、 または丸めた値が返り値の型の範囲外である場合、 結果の数値は指定されていない。 x が大きすぎる場合、領域 (domain) エラーが起こるかもしれない。

返り値


丸めた整数値。

エラー


EDOM x が大きすぎ、 (math_errhandling & MATH_ERRNO) が 0 でない。

準拠


C99.

関連項目


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

openSUSE Logo

コンテンツ