|
|
|
Defined in header <math.h> | ||
#define isunordered(x, y) /* implementation defined */ | (since C99) | |
Determines if the floating point numbersx andy are unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other.
Contents |
x | - | floating point value |
y | - | floating point value |
Nonzero integral value if eitherx ory is NaN,0 otherwise.
#include <math.h>#include <stdio.h> int main(void){printf("isunordered(NAN,1.0) = %d\n", isunordered(NAN,1.0));printf("isunordered(1.0,NAN) = %d\n", isunordered(1.0, NAN));printf("isunordered(NAN,NAN) = %d\n", isunordered(NAN, NAN));printf("isunordered(1.0,0.0) = %d\n", isunordered(1.0,0.0)); return0;}
Possible output:
isunordered(NAN,1.0) = 1isunordered(1.0,NAN) = 1isunordered(NAN,NAN) = 1isunordered(1.0,0.0) = 0
(C99) | classifies the given floating-point value (function macro)[edit] |
(C99) | checks if the given number is NaN (function macro)[edit] |
C++ documentation forisunordered |