isgreaterのヘルプ・マニュアル
日本語 英語
isgreater --help
man isgreater
ISGREATER(3) Linux Programmer’s Manual ISGREATER(3)
名前
isgreater, isgreaterequal, isless, islessequal, islessgreater,
isunordered - NaN に対して例外を発生せずに、浮動小数点数の大小関係の 判
定を行う
書式
#include
int isgreater(x, y);
int isgreaterequal(x, y);
int isless(x, y);
int islessequal(x, y);
int islessgreater(x, y);
int isunordered(x, y);
-lm でリンクする。
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
ここで説明する全ての関数: _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or
cc -std=c99
説明
(<、「小なり」のような) 通常の関係操作 (relation operations) は、オペラ
ンドの一方が NaN の場合には失敗する。これは例外の原因になる。これを避け
るため、C99 では次のようなマクロを定義している。これらのマクロはオペ ラ
ンドを 1 回だけ評価することが保証されている。オペランドには任意の実数の
浮動小数点数型を指定できる。
isgreater()
(x) > (y) を決定する。 x または y が NaN でも例外を発生しない。
isgreaterequal()
(x) >= (y) を決定する。 x または y が NaN でも例外を発生しない。
isless()
(x) < (y) を決定する。 x または y が NaN でも例外を発生しない。
islessequal()
(x) <= (y) を決定する。 x または y が NaN でも例外を発生しない。
islessgreater()
(x) < (y) || (x) > (y) を決定する。 x または y が NaN でも例外を
発生しない。このマクロは x != y と等価ではない。なぜなら、この評
価式は x または y が NaN の場合に true となるためである。
isunordered()
引き数が unordered かどうか、つまり引き数の少なくとも一方が NaN
かどうかを判定する。
返り値
isunordered() 以外のマクロは関係操作の結果を返す。一方の引き数が NaN の
場合、これらのマクロは 0 を返す。
isunordered() は x か y が NaN の場合 1 を、それ以外の場合 0 を返す。
エラー
エラーは発生しない。
準拠
C99, POSIX.1-2001.
注意
これらの関数は全てのハードウェアでサポートされているわけではない。サ ポ
ー トされていない場合は、マクロでエミュレートされる。エミュレートされる
場合は、性能上での不利となる。 NaN について心配しなくて構わない場合は、
これらの関数を使わないこと。
関連項目
fpclassify(3), isnan(3)
2008-08-05 ISGREATER(3)
ISGREATER(3) Linux Programmer’s Manual ISGREATER(3)
NAME
isgreater, isgreaterequal, isless, islessequal, islessgreater,
isunordered - floating-point relational tests without exception for NaN
SYNOPSIS
#include
int isgreater(x, y);
int isgreaterequal(x, y);
int isless(x, y);
int islessequal(x, y);
int islessgreater(x, y);
int isunordered(x, y);
Link with -lm.
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
All functions described here: _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE;
or cc -std=c99
DESCRIPTION
The normal relation operations (like <, "less than") will fail if one
of the operands is NaN. This will cause an exception. To avoid this,
C99 defines these macros. The macros are guaranteed to evaluate their
operands only once. The operands can be of any real floating-point
type.
isgreater()
determines (x) > (y) without an exception if x or y is NaN.
isgreaterequal()
determines (x) >= (y) without an exception if x or y is NaN.
isless()
determines (x) < (y) without an exception if x or y is NaN.
islessequal()
determines (x) <= (y) without an exception if x or y is NaN.
islessgreater()
determines (x) < (y) || (x) > (y) without an exception if x or y
is NaN. This macro is not equivalent to x != y because that
expression is true if x or y is NaN.
isunordered()
determines whether its arguments are unordered, that is, whether
at least one of the arguments is a NaN.
RETURN VALUE
The macros other than isunordered() return the result of the relational
comparison; these macros return 0 if either argument is a NaN.
isunordered() returns 1 if x or y is NaN and 0 otherwise.
ERRORS
No errors occur.
CONFORMING TO
C99, POSIX.1-2001.
NOTES
Not all hardware supports these functions, and where hardware support
isn’t provided, they will be emulated by macros. This will result in a
performance penalty. Don’t use these functions if NaN is of no concern
for you.
SEE ALSO
fpclassify(3), isnan(3)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2008-08-05 ISGREATER(3)