deal with nan inputs in cdfchn