Float / Scientific Notation State Diagram

Examples

0.123
-0.123
+0.123
.123
-.123
+.123
-123.E4
+123.E4
.123e4
123.456
-123.456
+123.456
.123e-4
-.123e-4
+.123e+4
123.456E-7
-123.456E+7
+123.456e+7

State Diagram

image missing

In the above diagram:

DIGIT→the characters "0" thru "9"
Ee→the character "E" or "e"
EOS→end of string
PERIOD→the period character (".")
SIGN→the character "+" or "-"

Note: The starting and ending spaces have been removed from the string.