islessgreater - C math.h

C examples for math.h:islessgreater

type

macro

From

<cmath>
<ctgmath>
<math.h>

Description

Returns whether x is less than or greater than y.

If one or both arguments are NaN, the function returns false.

Prototype

bool islessgreater (float x      , float y);
bool islessgreater (double x     , double y);
bool islessgreater (long double x, long double y);
     islessgreater(x,y)

Parameters

Parameter Description
x Values to be compared.
y Values to be compared.

Return value

The same as (x)<(y)||(x)>(y): true (1) if x is less than or greater than y. false (0) otherwise.

Example

Demo Code


#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;
}

Related Tutorials