Add tests for NaN and inf