C++ cmath isunordered


int isunordered(float x , float y);
int isunordered(double x , double y);
int isunordered(long double x, long double y);

The C++ <cmath> isunordered determines if the arguments are unordered.

Parameters:
x -The first argument.

y -The second argument.

Return type
int -Return 1 if the arguments are unordered.

Some points to note:

 i) The function return 1 if one of the arguments is NAN.

 ii) If character or int type is passed as argument the function with double as parameter type is called.

cout<< “isunordered(2e20 , 100)=” << isunordered(2e20 , 100) << endl ;

/*Passing NaN */
cout<< “isunordered(NAN , 0)=” << isunordered(NAN , 0) << endl ;

Output

isunordered(2e20 , 100)= 0
isunordered(NAN , 0)= 1