Title: Long integer data type Submitted by: John Reid Status: For Consideration References: Basic Functionality: Just as a procesor is required to support default and double precision reals, require support of default and long integers. Example: integer, parameter :: long = selected_int_kind(range(1)*2) integer (long) :: l,m,n Rationale: Long integers are needed increasingly in large programs, but if we do a declaration such as: integer, parameter :: long = selected_int_kind(range(1)*2) integer (long) :: l,m,n we cannot be sure that it will compile. Added by Peter Crouch In the past compilers have supported variable size integers with declarations such as: INTEGER*2 short INTEGER*4 medium INTEGER*8 long Fortran 90 introduced the KIND selector to achieve the same results. With the growth in 64 bit computing and increasing interoperatibility with C, enhanced by the new features in Fortran 2003, there is an increasing requirement for 64 bit or larger INTEGER variables. Estimated Impact: This proposal would formalise an often existing compiler facility by requiring that an integer type capable of holding values larger than the default integer type would always be available. Detailed Specification: 4.4 ... R403 intrinsic-type-spec is INTEGER [ kind-selector ] or LONG ... 4.4.1 Integer type The set of values for the integer type is a subset of the mathematical integers. A processor shall provide two or more representation methods that define sets of values for data of type integer. ... The type specifier for the integer type uses the keyword INTEGER. The keyword LONG is an alternate specifier for one kind of integer type. If the kind type parameter is not specified, the default kind parameter is KIND(0) and the type specified is default integer. If the type keyword LONG is specified, the kind value is KIND(??) and the type specified is long integer. The range of integers which can be held within a long integer datum shall be larger than that of a default integer datum. History: Comments: Peter Crouch, DWP: What the appropriate KIND value should be may depend on the outcome of discussions on the possible standardisation of KIND values in general. In view of Malcolm's comments below I have marked above where John's suggestion ends and my elaboration begins. Malcolm Cohen, Nihon NAG, Tokyo: I might agree on the desirability of requiring support for integers longer than 32 bits, but I do not like the suggested syntax. The suggested syntax is in fact completely unacceptable. It is too late now to stop users from having derived types called LONG_INTEGER, and all too likely that some already do. It is also unnecessary. The requirement that an integer kind exists with a larger range than default integer could be satisfied by requiring exactly that. However, the proposal talks about 64-bit integers, and then leaps to requiring some size bigger than default. That would be satisfied by 48-bit. It also ignores existing implementations where default integer is already 64 bits. BTW, that is not just Cray; NAG and some other vendors already offer such a compiler (ours is called "f95 -double"). Adding this feature would make almost all existing 64-bit default integer implementations non-standard, because almost no-one implements 128-bit integers. In fact, given that almost everyone supports 64-bit integers (and some support 64-bit default integers), what is this proposal intended to achieve? If it is just a convenient mechanism to specify a 64-bit integer type when the user wants default real/integer to remain 32-bit, just add a named constant INT64 to ISO_FORTRAN_ENV. In fact, doesn't Rich Maine's proposal do exactly that? (plus other things). SUMMARY: (1) New type name unnecessary and unacceptable. (2) Just support the Richard Maine proposal, perhaps modified to add another constant if we don't want to mandate an *exact* 64 bits. Do ***NOT*** call it "LONG", because all the C people will expect it to be the same as C_LONG.