added NaN test for check_nonnegative
added doc in code for check_nonnegative