Back to index

glibc  2.9
Functions
s_fdim.c File Reference
#include <math.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double __fdim (double x, double y)

Function Documentation

double __fdim ( double  x,
double  y 
)

Definition at line 24 of file s_fdim.c.

{
  int clsx = fpclassify (x);
  int clsy = fpclassify (y);

  if (clsx == FP_NAN || clsy == FP_NAN
      || (y < 0 && clsx == FP_INFINITE && clsy == FP_INFINITE))
    /* Raise invalid flag.  */
    return x - y;

  return x <= y ? 0 : x - y;
}