macro
<cmath> <ctgmath>
isunordered functionbool isunordered (float x , float y);bool isunordered (double x , double y);bool isunordered (long double x, long double y);
Is unordered
Returns whether x or y are unordered values:If one or both arguments are NaN, the arguments are unordered and the function returns true
. In no case the function raises a FE_INVALID exception.
In C, this is implemented as a macro that returns an int
value. The type of both x and y shall be float
, double
or long double
.
In C++, it is implemented with function overloads for each
floating-point type, each returning a
bool
value.
true
(1
) if either x or y is NaN.
false
(0
) otherwise.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* isunordered example */
#include <stdio.h> /* printf */
#include <math.h> /* isunordered, sqrt */
int main ()
{
double result;
result = sqrt (-1.0);
if (isunordered(result,0.0))
printf ("sqrt(-1.0) and 0.0 cannot be ordered");
else
printf ("sqrt(-1.0) and 0.0 can be ordered");
return 0;
}
sqrt(-1.0) and 0.0 cannot be ordered
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4