How to use islessequal() function to check whether floating point x is less or equal to floating point y in C

1 Answer

0 votes
#include <stdio.h>     
#include <math.h>     

int main(int argc, char **argv)
{	
	if (islessequal(0.0003, 0.0003))
		printf ("true\n");
	else
		printf ("false\n");
		
	if (islessequal(0.0002, 0.0003))
		printf ("true\n");
	else
		printf ("false\n");
	
	if (islessequal(0.0003, 0.0002))
		printf ("true\n");
	else
		printf ("false\n");
 
    return 0;
}


/*
run:
  
true
true
false

*/

 



answered Mar 22, 2016 by avibootz
edited Mar 22, 2016 by avibootz
...