isgreater - C math.h

C examples for math.h:isgreater

type

macro

From

<cmath>
<ctgmath>
<math.h>

Description

Returns whether x is greater than y.

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

Prototype

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

Parameters

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

Return value

The same as (x)>(y): true (1)

if x is greater than y. false (0) otherwise.

Example

Demo Code

#include <stdio.h>
#include <math.h> /* isgreater, log */

int main ()/*  w  w w .java2  s .  c  om*/
{
  double result = log (10.0);

  if (isgreater(result,0.0))
      printf ("log(10.0) is positive");
  else
      printf ("log(10.0) is not positive");

  return 0;
}

Related Tutorials