.\" Copyright 2001 Andries Brouwer . .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk .\" .\" .\" %%%LICENSE_START(VERBATIM) .\" 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. .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" 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 2020\-11\-01 "" "Linux Programmer's Manual" .SH 名前 lround, lroundf, lroundl, llround, llroundf, llroundl \- 最も近い整数値に丸める .SH 書式 .nf \fB#include \fP .PP \fBlong lround(double \fP\fIx\fP\fB);\fP \fBlong lroundf(float \fP\fIx\fP\fB);\fP \fBlong lroundl(long double \fP\fIx\fP\fB);\fP .PP \fBlong long llround(double \fP\fIx\fP\fB);\fP \fBlong long llroundf(float \fP\fIx\fP\fB);\fP \fBlong long llroundl(long double \fP\fIx\fP\fB);\fP .fi .PP \fI\-lm\fP でリンクする。 .PP .RS -4 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .RE .PP .ad l 上記の全ての関数: .RS 4 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L .RE .ad .SH 説明 これらの関数は最も近い整数に引数を丸める。現在の丸め方向 (\fBfenv\fP(3) 参照) に関係なく最も近い整数に丸められ、半分の場合は 0 から遠い方の整数に丸められることになる。 .PP 関数 \fBround\fP(3), \fBceil\fP(3) と違い、これらの関数の返り値の型は引数の型と異なる点に注意すること。 .SH 返り値 これらの関数は丸めた整数値を返す。 .PP .\" The return value is -(LONG_MAX - 1) or -(LLONG_MAX -1) \fIx\fP が NaN か無限大の場合、もしくは丸めた値が大き過ぎて \fIlong\fP (\fBll*\fP 関数の場合には \fIlong long\fP) に格納できない場合、 領域エラー (domain error) が発生し、返り値は不定となる。 .SH エラー これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP 以下のエラーが発生する可能性がある。 .TP 領域エラー (domain error): \fIx\fP が NaN か無限大、もしくは丸めた値が大き過ぎる .\" .I errno .\" is set to .\" .BR EDOM . 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 .PP .\" FIXME . Is it intentional that these functions do not set errno? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6797 これらの関数は \fIerrno\fP を設定しない。 .SH バージョン これらの関数は glibc バージョン 2.1 で初めて登場した。 .SH 属性 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lbw33 lb lb l l l. インターフェース 属性 値 T{ \fBlround\fP(), \fBlroundf\fP(), \fBlroundl\fP(), .br \fBllround\fP(), \fBllroundf\fP(), \fBllroundl\fP() T} Thread safety MT\-Safe .TE .SH 準拠 C99, POSIX.1\-2001, POSIX.1\-2008. .SH 関連項目 \fBceil\fP(3), \fBfloor\fP(3), \fBlrint\fP(3), \fBnearbyint\fP(3), \fBrint\fP(3), \fBround\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。