xref: /haiku/src/system/libroot/posix/musl/math/fdim.c (revision 84cc2b9655c438c28cd0073991f41684d41d1fe8)
1 #include <math.h>
2 
3 double fdim(double x, double y)
4 {
5 	if (isnan(x))
6 		return x;
7 	if (isnan(y))
8 		return y;
9 	return x > y ? x - y : 0;
10 }
11