From d54fe7c1f704a63824c5bfa0ece65245572e9b27 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 4 Mar 2015 21:21:30 -0500 Subject: Initial commit --- src/slalib/sun67.htx/node55.html | 200 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 src/slalib/sun67.htx/node55.html (limited to 'src/slalib/sun67.htx/node55.html') diff --git a/src/slalib/sun67.htx/node55.html b/src/slalib/sun67.htx/node55.html new file mode 100644 index 0000000..390f876 --- /dev/null +++ b/src/slalib/sun67.htx/node55.html @@ -0,0 +1,200 @@ + + + + +SLA_DFLTIN - Decode a Double Precision Number + + + + + + + + + + + + +

+ +next + +up + +previous +
+ Next: SLA_DH2E - Az,El to +
+Up: SUBPROGRAM SPECIFICATIONS +
+ Previous: SLA_DEULER - Euler Angles to Rotation Matrix +

+

+

SLA_DFLTIN - Decode a Double Precision Number +   +

+
+
ACTION: +
Convert free-format input into double precision floating point. +
CALL: +
CALL sla_DFLTIN (STRING, NSTRT, DRESLT, JFLAG) +

+

+
GIVEN: +
+
+ + + + + + + + + + + + + +
STRINGCstring containing number to be decoded
NSTRTIpointer to where decoding is to commence
DRESLTDcurrent value of result
+

+
RETURNED: +
+
+ + + + + + + + + + + + + +
NSTRTIadvanced to next number
DRESLTDresult
JFLAGIstatus: -1 = -OK, 0 = +OK, 1 = null result, 2 = error
+

+
NOTES: +
+
1. +
The reason sla_DFLTIN 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. +
2. +
A TAB is interpreted as a space, and lowercase characters are + interpreted as uppercase. n.b. The test for TAB is + ASCII-specific. +
3. +
The basic format is the sequence of fields $\pm n.n x \pm n$, where $\pm$ is a sign + character `+' or `-', n means a string of decimal digits, + `.' is a decimal point, and x, which indicates an exponent, + means `D' or `E'. Various combinations of these fields can be + omitted, and embedded blanks are permissible in certain places. +
4. +
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. +
+
5. +
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_DFLTIN 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. +
+
6. +
Both signs are optional. The default is +. +
7. +
The mantissa n.n defaults to unity. +
8. +
The exponent $x\!\pm\!n$ defaults to `D0'. +
9. +
The strings of decimal digits may be of any length. +
10. +
The decimal point is optional for whole numbers. +
11. +
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 DRESLT is left untouched. +
12. +
NSTRT = 1 for the first character in the string. +
13. +
On return from sla_DFLTIN, 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_DFLTIN, otherwise + all subsequent calls will return a null result. +
14. +
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. +
+
15. +
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_DFLTIN does not detect that `1D999' is unacceptable + (on a computer where this is so) until the entire number + has been decoded. +
16. +
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. +
17. +
Decoding is left to right, one pass. +
18. +
See also sla_FLOTIN and sla_INTIN. +
+

+ +next + +up + +previous +
+ Next: SLA_DH2E - Az,El to +
+Up: SUBPROGRAM SPECIFICATIONS +
+ Previous: SLA_DEULER - Euler Angles to Rotation Matrix +

+

+

+SLALIB --- Positional Astronomy Library
Starlink User Note 67
P. T. Wallace
12 October 1999
E-mail:ptw@star.rl.ac.uk
+
+ + -- cgit