Return 0 if both values are NaN.