.\" Copyright 2001 Andries Brouwer . .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk .\" .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Japanese Version Copyright (c) 2001, 2005 Yuichi SATO .\" all rights reserved. .\" Translated Sat Jul 14 11:21:46 JST 2001 .\" by Yuichi SATO .\" Updated & Modified Sun Jan 16 06:26:19 JST 2005 .\" by Yuichi SATO .\" Updated 2008-09-18, Akihiro MOTOKI .\" .TH LROUND 3 2010-09-20 "" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O lround, lroundf, lroundl, llround, llroundf, llroundl \- round to .\"O nearest integer, away from zero lround, lroundf, lroundl, llround, llroundf, llroundl \- (0 から遠い方の) 最も近い整数値に丸める .\"O .SH SYNOPSIS .nf .B #include .sp .BI "long int lround(double " x ); .br .BI "long int lroundf(float " x ); .br .BI "long int lroundl(long double " x ); .sp .BI "long long int llround(double " x ); .br .BI "long long int llroundf(float " x ); .br .BI "long long int llroundl(long double " x ); .fi .sp .\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .ad l .\"O All functions shown above: ここに記載されている全ての関数: .RS 4 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br or .I cc\ -std=c99 .RE .ad \"O .SH DESCRIPTION .SH 説明 .\"O These functions round their argument to the nearest integer value, .\"O rounding away from zero, .\"O regardless of the current rounding direction (see .\"O .BR fenv (3)). これらの関数は最も近い整数に引き数を丸める。 現在の丸め方向に関係なく、 0 から遠い方の最も近い整数に引き数は丸められる (現在の丸め方向については .BR fenv (3) 参照)。 .\"O Note that unlike .\"O .BR round (3), .\"O .BR ceil (3), .\"O etc., the return type of these functions differs from .\"O that of their arguments. .BR round (3), .BR ceil (3) などと違い、これらの関数の返り値の型は引き数の型と異なる点に注意すること。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O These functions return the rounded integer value. これらの関数は丸めた整数値を返す。 .\"O If .\"O .I x .\"O is a NaN or an infinity, .\"O or the rounded value is too large to be stored in a .\"O .I long .\"O .RI ( "long long" .\"O in the case of the .\"O .B ll* .\"O functions) .\"O then a domain error occurs, and the return value is unspecified. .I x が NaN か無限大の場合、もしくは丸めた値が大き過ぎて .I long .RB ( ll* 関数の場合には .IR "long long" ) に格納できない場合、 領域エラー (domain error) が発生し、返り値は不定となる。 .\" The return value is -(LONG_MAX - 1) or -(LLONG_MAX -1) .\"O .SH ERRORS .SH エラー .\"O See .\"O .BR math_error (7) .\"O for information on how to determine whether an error has occurred .\"O when calling these functions. これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は .BR math_error (7) を参照のこと。 .PP .\"O The following errors can occur: 以下のエラーが発生する可能性がある。 .TP .\"O Domain error: \fIx\fP is a NaN or infinite, or the rounded value is too large 領域エラー (domain error): \fIx\fP が NaN か無限大、もしくは丸めた値が大き過ぎる .\" .I errno .\" is set to .\" .BR EDOM . .\"O An invalid floating-point exception .\"O .RB ( FE_INVALID ) .\"O is raised. 不正 (invalid) 浮動小数点例外 .RB ( FE_INVALID ) が上がる。 .PP .\"O These functions do not set .\"O .IR errno . これらの関数は .I errno を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6797 .\"O .SH VERSIONS .SH バージョン .\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 .\"O .SH "CONFORMING TO" .SH 準拠 C99, POSIX.1-2001. .\"O .SH "SEE ALSO" .SH 関連項目 .BR ceil (3), .BR floor (3), .BR lrint (3), .BR nearbyint (3), .BR rint (3), .BR round (3)