The reason sla_FLOTIN has separate `OK' status values
for + and is to enable minus zero to be detected.
This is of crucial importance
when decoding mixed-radix numbers. For example, an angle
expressed as degrees, arcminutes and arcseconds may have a
leading minus sign but a zero degrees field.
A TAB is interpreted as a space, and lowercase characters are
interpreted as uppercase. n.b. The test for TAB is
ASCII-specific.
The basic format is the sequence of fields
,
where is a sign
character `+' or `', means a string of decimal digits,
`.' is a decimal point, and , which indicates an exponent,
means `D' or `E'. Various combinations of these fields can be
omitted, and embedded blanks are permissible in certain places.
Spaces:
Leading spaces are ignored.
Embedded spaces are allowed only after +, , D or E,
and after the decimal point if the first sequence of
digits is absent.
Trailing spaces are ignored; the first signifies
end of decoding and subsequent ones are skipped.
Delimiters:
Any character other than +,,0-9,.,D,E or space may be
used to signal the end of the number and terminate decoding.
Comma is recognized by sla_FLOTIN as a special case; it
is skipped, leaving the pointer on the next character. See
13, below.
Decoding will in all cases terminate if end of string
is reached.
Both signs are optional. The default is +.
The mantissa defaults to unity.
The exponent defaults to `E0'.
The strings of decimal digits may be of any length.
The decimal point is optional for whole numbers.
A null result occurs when the string of characters
being decoded does not begin with +,,0-9,.,D or E, or
consists entirely of spaces. When this condition is
detected, JFLAG is set to 1 and RESLT is left untouched.
NSTRT = 1 for the first character in the string.
On return from sla_FLOTIN, NSTRT is set ready for the next
decode - following trailing blanks and any comma. If a
delimiter other than comma is being used, NSTRT must be
incremented before the next call to sla_FLOTIN, otherwise
all subsequent calls will return a null result.
Errors (JFLAG=2) occur when:
a +, , D or E is left unsatisfied; or
the decimal point is present without at least
one decimal digit before or after it; or
an exponent more than 100 has been presented.
When an error has been detected, NSTRT is left
pointing to the character following the last
one used before the error came to light. This
may be after the point at which a more sophisticated
program could have detected the error. For example,
sla_FLOTIN does not detect that `1E999' is unacceptable
(on a computer where this is so)
until the entire number has been decoded.
Certain highly unlikely combinations of mantissa and
exponent can cause arithmetic faults during the
decode, in some cases despite the fact that they
together could be construed as a valid number.