J3/05-233r1 To: J3 From: Malcolm Cohen Date: 2005/08/04 Subject: Edits for long integers References: WG5/N1626, item UK-005, 05-233 1. Introduction This is work item UK-005 in WG5/N1626. It is on the A-list. 2. Basic Requirement Require the support of long integers declared thus: integer, parameter :: long = selected_int_kind(18) integer (long) :: l,m,n 3. Rationale Long integers are needed increasingly in large programs, but if we make the above declaration in a program we cannot be sure that it will compile. 4. Detailed Specification: Require the support of integers whose kind type parameter value is selected_int_kind(18). 5. Other considerations Having a range requirement for integers but no requirement for the real type looks a bit inconsistent - at the moment, zero is guaranteed to be a real value, but that appears to be the only requirements on default real/double precision. However, REAL(c_float) and REAL(c_double) have requirements on them, inherited from C (clause 5.2.4.2.2, p25-26) - which looks even more inconsistent. ADDITIONAL SPECIFICATION: We should add minimum requirements for floating-point similar to C, which has: for float: precision>=6, range>=37; for double: precision>=10, range>=37. The first should be a recommendation for default real, the second should be a requirement for double precision real. (We don't need to be as strict as C, since users can select small but adequate precision using SELECTED_REAL_KIND rather than being limited to a single keyword "float".) 6. Syntax There is no new syntax. 7. Editorial considerations (1) This is trivial, requiring no additional implementation effort on the part of the vast majority of Fortran 95 compiler vendors. Nothing new is apparent from the user side, other than the guarantee of portability. Therefore it does not warrant inclusion in the Introduction (it is not a "new" feature as such). (2) The standard uses the phrasing "a processor shall" and "the processor shall" inconsistently. It uses the former only 5 times (coincidentally mostly in the very clause we are editing now) and the latter 25 times (in clauses 6, 7, 8, 9, 10, 13, 14 and 15). We should fix the clauses 3&4 version to be the same as in the rest of the standard. Edits to do this will be included in 008 rather than here. 8. Edits to 04-007 Add a new paragraph after the first paragraph of subclause 4.4.1 "Integer type", [36:20+] "The processor shall provide at least one representation method with a decimal exponent range greater than or equal to 18." {This could be inserted into the first paragraph, but that is already long enough.} Add a new paragraph after the fourth paragraph of subclause 4.4.2 "Real type" (that is immediately before "R416 <>..."), [38:13+] "It is recommended that the decimal precision of default real be at least 6, and that its decimal exponent range be at least 37. The decimal precision of double precision real shall be at least 10, and its decimal exponent range shall be at least 37." ===END===