A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/reference/cmath/islessgreater/ below:

macro

<cmath> <ctgmath>

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

Is less or greater

Returns whether x is less than or greater than y.

If one or both arguments are NaN, the function returns false, but no FE_INVALID exception is raised (note that the expression x<y||x>y may raise such an exception in this case).

In C, this is implemented as a macro that returns an int value. The type of both x and y shall be float, double or long double.

In C++, it is implemented with function overloads for each

floating-point type

, each returning a

bool

value.



Parameters
x, 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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* islessgreater example */
#include <stdio.h>      /* printf */
#include <math.h>       /* islessgreater, log */

int main ()
{
  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;
}

Output:


See also
isgreater
Is greater (macro)
isgreaterequal
Is greater or equal (macro)
isless
Is less (macro)
islessequal
Is less or equal (macro)
isunordered
Is unordered (macro)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4