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