A DESCRIPTION OF THE PROBLEM :
The constructor for StreamTokenizer sets several syntax options by default.
Notably:
1. It calls parseNumbers(); which means that unquoted character 4 will be returned as 4.0.
2. it calls commentChar('/'); which means that strings like 4/2=2 will first return 4.0 and then skip to after the next End Of Line, thus skipping all characters after the 4 character.
The documentation of StreamTokenizer should be updated to include the defaults set in the constructor.
The constructor for StreamTokenizer sets several syntax options by default.
Notably:
1. It calls parseNumbers(); which means that unquoted character 4 will be returned as 4.0.
2. it calls commentChar('/'); which means that strings like 4/2=2 will first return 4.0 and then skip to after the next End Of Line, thus skipping all characters after the 4 character.
The documentation of StreamTokenizer should be updated to include the defaults set in the constructor.