.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) .\" Distributed under GPL .\" 2002-07-27 Walter Harms .\" this was done with the help of the glibc manual .\" .\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO .\" all rights reserved. .\" Translated Fri Aug 20 04:03:26 JST 2004 .\" by Yuichi SATO .\" Updated & Modified Sat Jan 15 02:32:55 JST 2005 by Yuichi SATO .\" Updated 2008-09-18, Akihiro MOTOKI .\" .TH ISGREATER 3 2010-09-20 "" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O isgreater, isgreaterequal, isless, islessequal, islessgreater, .\"O isunordered \- floating-point relational tests without exception for NaN isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered \- NaN に対して例外を発生せずに、浮動小数点数の大小関係の判定を行う .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "int isgreater(" x ", " y ); .sp .BI "int isgreaterequal(" x ", " y ); .sp .BI "int isless(" x ", " y ); .sp .BI "int islessequal(" x ", " y ); .sp .BI "int islessgreater(" x ", " y ); .sp .BI "int isunordered(" x ", " y ); .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 described here: ここで説明する全ての関数: .RS _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br or .I cc\ -std=c99 .RE .ad b .\"O .SH DESCRIPTION .SH 説明 .\"O The normal relation operations (like \fB<\fP, "less than") .\"O will fail if one of the operands is NaN. .\"O This will cause an exception. .\"O To avoid this, C99 defines these macros. .\"O The macros are guaranteed to evaluate their operands only once. .\"O The operands can be of any real floating-point type. (\fB<\fP、「小なり」のような) 通常の関係操作 (relation operations) は、 オペランドの一方が NaN の場合には失敗する。 これは例外の原因になる。 これを避けるため、C99 では次のようなマクロを定義している。 これらのマクロはオペランドを 1 回だけ評価することが保証されている。 オペランドには任意の実数の浮動小数点数型を指定できる。 .TP .BR isgreater () .\"O determines \fI(x)\ >\ (y)\fP without an exception .\"O if \fIx\fP or \fIy\fP is NaN. \fI(x)\ >\ (y)\fP を決定する。 \fIx\fP または \fIy\fP が NaN でも例外を発生しない。 .TP .BR isgreaterequal () .\"O determines \fI(x)\ >=\ (y)\fP without an exception .\"O if \fIx\fP or \fIy\fP is NaN. \fI(x)\ >=\ (y)\fP を決定する。 \fIx\fP または \fIy\fP が NaN でも例外を発生しない。 .TP .BR isless () .\"O determines \fI(x)\ <\ (y)\fP without an exception .\"O if \fIx\fP or \fIy\fP is NaN. \fI(x)\ <\ (y)\fP を決定する。 \fIx\fP または \fIy\fP が NaN でも例外を発生しない。 .TP .BR islessequal () .\"O determines \fI(x)\ <=\ (y)\fP without an exception .\"O if \fIx\fP or \fIy\fP is NaN. \fI(x)\ <=\ (y)\fP を決定する。 \fIx\fP または \fIy\fP が NaN でも例外を発生しない。 .TP .BR islessgreater () .\"O determines \fI(x)\ < (y) || (x) >\ (y)\fP .\"O without an exception if \fIx\fP or \fIy\fP is NaN. .\"O This macro is not equivalent to \fIx\ !=\ y\fP because that expression is .\"O true if \fIx\fP or \fIy\fP is NaN. \fI(x)\ < (y) || (x) >\ (y)\fP を決定する。 \fIx\fP または \fIy\fP が NaN でも例外を発生しない。 このマクロは \fIx\ !=\ y\fP と等価ではない。 なぜなら、この評価式は \fIx\fP または \fIy\fP が NaN の場合に true となるためである。 .TP .BR isunordered () .\"O determines whether its arguments are unordered, that is, whether .\"O at least one of the arguments is a NaN. 引き数が unordered かどうか、つまり引き数の少なくとも一方が NaN かどうか を判定する。 .\"O .SH RETURN VALUE .SH 返り値 .\"O The macros other than .\"O .BR isunordered () .\"O return the result of the relational comparison; .\"O these macros return 0 if either argument is a NaN. .BR isunordered () 以外のマクロは関係操作の結果を返す。 一方の引き数が NaN の場合、これらのマクロは 0 を返す。 .\"O .BR isunordered () .\"O returns 1 if \fIx\fP or \fIy\fP is NaN and 0 otherwise. .BR isunordered () は \fIx\fP か \fIy\fP が NaN の場合 1 を、 それ以外の場合 0 を返す。 .\"O .SH ERRORS .SH エラー .\"O No errors occur. エラーは発生しない。 .\"O .SH "CONFORMING TO" .SH 準拠 C99, POSIX.1-2001. .\"O .SH NOTES .SH 注意 .\"O Not all hardware supports these functions, .\"O and where hardware support isn't provided, they will be emulated by macros. .\"O This will result in a performance penalty. これらの関数は全てのハードウェアでサポートされているわけではない。 サポートされていない場合は、マクロでエミュレートされる。 エミュレートされる場合は、性能上での不利となる。 .\"O Don't use these functions if NaN is of no concern for you. NaN について心配しなくて構わない場合は、 これらの関数を使わないこと。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR fpclassify (3), .BR isnan (3)