다음을 통해 공유


isgreater, isgreaterequal, isless, islessequal, islessgreaterisunordered

두 부동 소수점 값 간의 순서 지정 관계를 결정합니다.

구문

int isgreater(
   /* floating-point */ x,
   /* floating-point */ y
); /* C-only macro */

int isgreaterequal(
   /* floating-point */ x,
   /* floating-point */ y
); /* C-only macro */

int isless(
   /* floating-point */ x,
   /* floating-point */ y
); /* C-only macro */

int islessequal(
   /* floating-point */ x,
   /* floating-point */ y
); /* C-only macro */

int islessgreater(
   /* floating-point */ x,
   /* floating-point */ y
); /* C-only macro */

int isunordered(
   /* floating-point */ x,
   /* floating-point */ y
); /* C-only macro */
template <class FloatingType1, class FloatingType2>
inline bool isgreater(
   FloatingType1 x,
   FloatingType2 y
) throw(); /* C++-only template function */

template <class FloatingType1, class FloatingType2>
inline bool isgreaterequal(
   FloatingType1 x,
   FloatingType2 y
) throw(); /* C++-only template function */

template <class FloatingType1, class FloatingType2>
inline bool isless(
   FloatingType1 x,
   FloatingType2 y
) throw(); /* C++-only template function */

template <class FloatingType1, class FloatingType2>
inline bool islessequal(
   FloatingType1 x,
   FloatingType2 y
) throw(); /* C++-only template function */

template <class FloatingType1, class FloatingType2>
inline bool islessgreater(
   FloatingType1 x,
   FloatingType2 y
) throw(); /* C++-only template function */

template <class FloatingType1, class FloatingType2>
inline bool isunordered(
   FloatingType1 x,
   FloatingType2 y
) throw(); /* C++-only template function */

매개 변수

x, y
비교할 부동 소수점 값입니다.

반환 값

모든 비교에서 동일한 기호의 무한대는 같음과 비교됩니다. 음의 무한대는 유한 값 또는 양수 무한대보다 작습니다. 양의 무한대는 유한 값 또는 음의 무한대보다 큽합니다. 0은 기호에 관계없이 동일합니다. NaN은 다른 NaN을 포함하여 값보다 작거나 같거나 그보다 크지 않습니다.

두 인수가 모두 NaN이 아닌 경우 y 순서 지정 매크로는 islessequal isgreaterequalisgreaterisless0이 아닌 값을 반환합니다.x 이러한 매크로는 인수 중 하나 또는 둘 다 NaN이거나 순서 지정 관계가 false이면 0을 반환합니다. 함수 폼은 동일한 방식으로 동작하지만 반환 true 하거나 false.

둘 다 x NaN이 아니고 y 0이 아닌 경우 매크로는 islessgreater 0이 아닌 값을 반환하며 x 보다 작거나 큽y니다. 인수 중 하나 또는 둘 다 NaN이거나 값이 같은 경우 0을 반환합니다. 함수 폼은 동일한 방식으로 동작하지만 반환 true 하거나 false.

매크로는 isunordered NaN이거나 둘 다 NaN인 경우 yx0이 아닌 값을 반환합니다. 그렇지 않으면 0을 반환합니다. 함수 폼은 동일한 방식으로 동작하지만 반환 true 하거나 false.

설명

이러한 비교 작업은 C로 컴파일될 때 매크로로 구현되고 C++로 컴파일될 때 인라인 템플릿 함수로 구현됩니다.

요구 사항

함수 필수 헤더(C) 필수 헤더(C++)
isgreater, isgreaterequal, isless
islessequal, , islessgreaterisunordered
<math.h> <math.h> 또는 <cmath>

호환성에 대한 자세한 내용은 호환성을 참조하세요.

참고 항목

수학 및 부동 소수점 지원
isfinite, , _finite_finitef
isinf
isnan, , _isnan_isnanf
_fpclass, _fpclassf