Returns whether x is less than or equal to y.
The C99 prototype is listed as follows.
macro islessequal(x,y)
The C++11 prototype is listed as follows.
bool islessequal (float x , float y); bool islessequal (double x , double y); bool islessequal (long double x, long double y);
This function has the following parameter.
The same as (x)<=(y): true (1) if x is less than or equal to y. false (0) otherwise.
#include <stdio.h> /* printf */
#include <math.h> /* islessequal, log */
//from w w w .j a va 2 s.c o m
int main (){
double result;
result = log (10.0);
if (islessequal(result,0.0))
printf ("log(10.0) is not positive");
else
printf ("log(10.0) is positive");
return 0;
}
The code above generates the following result.
#include <stdio.h>
#include <math.h>
//from ww w . j av a 2 s . c o m
int main(void)
{
printf("islessequal(2.0,1.0) = %d\n", islessequal(2.0,1.0));
printf("islessequal(1.0,2.0) = %d\n", islessequal(1.0,2.0));
printf("islessequal(1.0,1.0) = %d\n", islessequal(1.0,1.0));
printf("islessequal(INFINITY,1.0) = %d\n", islessequal(INFINITY,1.0));
printf("islessequal(1.0,NAN) = %d\n", islessequal(1.0,NAN));
return 0;
}
The code above generates the following result.