Float package:basement
Single-precision floating point numbers. It is desirable that this
type be at least equal in range and precision to the IEEE
single-precision type.
Read an Floating like number of the form:
Call a function with:
- A boolean representing if the number is negative
- The digits part represented as a single natural number (123.456 is
represented as 123456)
- The number of digits in the fractional part (e.g. 123.456 =>
3)
- The exponent if any
The code is structured as a simple state machine that:
- Optionally Consume a - sign
- Consume number for the integral part
- Optionally
- Consume .
- Consume remaining digits if not already end of string
- Optionally Consume a e or E follow by an
optional - and a number