isunordered(): This function is available in the file cmath. This function checks whether x or y are unordered values. If one or both arguments are NAN, then it returns true. So unordered values are NAN.
This function returns true if x or y is NAN otherwise, it returns false.
Parameters: Two parameters are required for this function.
x: The first value.
y: The second value.
Syntax:
isunordered(x,y)
For Example:
isunordered(NAN,9) = > It return true, because one of the argument is NAN.
isunordered(12,9) = > It returns false, because any of the arguments are not NAN.
Approach
C++
#include <bits/stdc++.h>using namespace std;int main(){float x = NAN, y = 9;cout << isunordered(x, y) << "\n";return 0;}
No comments:
Post a Comment