add check_positive_finite with tests