X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fmath%2Ffdim.c;fp=src%2Fmath%2Ffdim.c;h=fb25521cddc284a1c2cec662998229779467a7e7;hp=0000000000000000000000000000000000000000;hb=b69f695acedd4ce2798ef9ea28d834ceccc789bd;hpb=d46cf2e14cc4df7cc75e77d7009fcb6df1f48a33 diff --git a/src/math/fdim.c b/src/math/fdim.c new file mode 100644 index 00000000..fb25521c --- /dev/null +++ b/src/math/fdim.c @@ -0,0 +1,10 @@ +#include "libm.h" + +double fdim(double x, double y) +{ + if (isnan(x)) + return x; + if (isnan(y)) + return y; + return x > y ? x - y : 0; +}