fdiml.c 304 B

123456789101112131415161718
  1. #include <math.h>
  2. #include <float.h>
  3. #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
  4. long double fdiml(long double x, long double y)
  5. {
  6. return fdim(x, y);
  7. }
  8. #else
  9. long double fdiml(long double x, long double y)
  10. {
  11. if (isnan(x))
  12. return x;
  13. if (isnan(y))
  14. return y;
  15. return x > y ? x - y : 0;
  16. }
  17. #endif