C examples for math.h:islessgreater
macro
<cmath> <ctgmath> <math.h>
Returns whether x is less than or greater than y.
If one or both arguments are NaN, the function returns false.
bool islessgreater (float x , float y); bool islessgreater (double x , double y); bool islessgreater (long double x, long double y); islessgreater(x,y)
Parameter | Description |
---|---|
x | Values to be compared. |
y | Values to be compared. |
The same as (x)<(y)||(x)>(y): true (1) if x is less than or greater than y. false (0) otherwise.
#include <stdio.h> #include <math.h> /* islessgreater, log */ int main()// w w w . ja v a2 s.c o m { int a = 0; if (islessgreater(0/1 , a)) printf("0/1 is not zero\n"); else printf("0/1 is zero\n"); double result; result = log(10.0); if (islessgreater(result, 0.0)) printf("log(10.0) is not zero"); else printf("log(10.0) is zero"); return 0; }