Here are three questions about Stream::parseInt() and Stream::parseFloat().
-
Why do they skip all leading characters except '-' and digits 0-9? Why not just space like most parse functions? Reading "abc123" as a valid number, 123, seems strange.
-
How can you tell if no digits were read? The string "xyz" returns zero.
-
Why do they swallow the terminating non-digit? Often this character is important. If you call parseInt() with the string "567pq", 'p' is consumed and the next read returns 'q'.