123456789101112131415161718192021222324252627 |
- #include "math.h"
- #include "math_private.h"
- #include <errno.h>
- double fdim(double x, double y)
- {
- int cx = __fpclassify(x);
- int cy = __fpclassify(y);
- if (cx == FP_NAN || cy == NAN)
- return x - y;
- if (x <= y)
- return .0;
- double z = x - y;
- if (isinf(z) && cx != FP_INFINITE && cy != FP_INFINITE)
- __set_errno(ERANGE);
- return z;
- }
- libm_hidden_def(fdim)
|