added NaN test for check_finite
added doc in code for check_finite