fdim.c 136 B

12345678910
  1. #include <math.h>
  2. double fdim(double x, double y)
  3. {
  4. if (isnan(x))
  5. return x;
  6. if (isnan(y))
  7. return y;
  8. return x > y ? x - y : 0;
  9. }