|int isless(float x , float y);|
|int isless(double x , double y);|
|int isless(long double x, long double y);|
In C programming the <math.h> isless determines if the first argument is less than the second argument.
x -The first argument.
y -The second argument.
int -Return 1 is x<y else 0.
Some points to note:
i) The value of isless(x , y) is same as (x)<(y).The only difference between them is unlike ‘(x)<(y)’, isless(x, y) does not raise the ‘invalid’ floating-point exception when x and y are unordered.
ii) +∞ is treated as greater than any valid value,-∞ is treated as smaller than any valid value.
iii) If one of the arguments is NaN,0 is always returned.
iv) If character or int type is passed as argument the function with double as parameter type is called.
x1 = 2.2e20 , x2=2.2e20 ;
float fx = 11 , fy = 10 ;
long double ldx = 10 , ldy = 11 ;
printf(“%i”, isless( dx , dy) ) ; //calls the 2nd version
printf(“\n%i”, isless( fx , fy) ) ; //calls the 1st version
printf(“\n%i”, isless( ldx , ldy) ) ;//calls the 3rd version
printf(“\n%i”, isless( x1 , x2) ) ;
printf(“\n%i”, isless( NAN , INFINITY) ) ;
Output in Visual Studio,