Float State Diagram

Sample of Float Strings

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

Parse a string and verify it is a float.

image missing

In the above diagram:

DIGITthe characters "0" thru "9"
Eethe character "E" or "e"
EOSend of string
PERIODthe period character (".")
SIGNthe character "+" or "-"

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