Correctly recognizes negative numbers and decimals