The isunordered() function is defined in <cmath.h> and checks whether the value of first argument can be meaningfully compared with the second argument. If the first argument cannot be meaningfully compared with the second argument (i.e one or both are NAN), it return 1 otherwise 0.
bool isunordered(float x, float y);
bool isunordered(double x, double y);
Parameters: It takes two values x and y i.e values to check whether they are unordered.
Returns: It returns 1 if the value of x or y are NAN, Otherwise it returns 0.
Below programs illustrate the isunordered() function in C++:
The value of x is= 6.3 The value of y is= -nan isunordered(x, y) = 1
Explanation: In the example 1 the value of y is NAN thats why function returns 1.
The value of x is= 4.6 The value of y is= 9.2 isunordered(x, y) = 0
Explanation: In the example 2 the value of x and y are not NAN thats why the function returns 0.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- What happens when a virtual function is called inside a non-virtual function in C++
- Function Overloading vs Function Overriding in C++
- Difference between Virtual function and Pure virtual function in C++
- How to call function within function in C or C++
- Difference between virtual function and inline function in C++
- Can we call an undeclared function in C++?
- Can we use function on left side of an expression in C and C++?
- Declare a C/C++ function returning pointer to array of integer pointers
- Function overloading and return type
- Default arguments and virtual function
- Function overloading and const keyword
- How to measure time taken by a function in C?
- Comparator function of qsort() in C
- Can we access private data members of a class without using a member or a friend function?
- Function Overloading and float in C++
- Extra brackets with function names in C/C++
- Function Interposition in C with an example of user defined malloc()
- A C/C++ Function Call Puzzle
- std::tuple, std::pair | Returning multiple values from a function using Tuple and Pair in C++
- Bind function and placeholders in C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.