
Character Sets and Collating Sequences ______________ A-l A CHARACTER SETS AND COLLATING SEQUENCES A.I Processor-Dependent Character Sets Default character type: The character set of the default character type contains at least all characters of the Fortran character set. In addition to the Fortran character set, a Fortran processor may support other representable cha­ racters, which may appear only in character literal constants, in character string edit descriptors, in comments, and in formatted records. The processor character set may contain control characters. Nondefault character type: If a Fortran processor supports in addition to the default character type one or more nondefault character types, the cha­ racters of such a nondefault character type may appear only in character literal constants of that type or in formatted records. In the last case, the types of the datum in the record and of the corresponding input/output list item must agree. One character in the character set of a nondefault character type is designated as the blank character; this blank character of the non default character type may be used as the padding character for formatted input. Collating sequence Each processor-dependent character set has its own collating sequence. The first character has position 0, the second has position 1, and so on. The ICHAR intrinsic function returns for a given character the position of this character in the processor-dependent collating sequence. For example, the function refe­ rence ICHAR(,X') returns the integer value 231 if the Fortran processor uses the EBCDIC character set. And conversely, the CHAR intrinsic function retu~ns for a given nonnegative integer value the character that corresponds to this given po- ~ sition in the processor-dependent collating sequence. For example, CHAR(231) returns the character 'X' if the EBCDIC character set is used. A.2 ASCII Character Set The ASCII character set is a standard character set. The International Fortran Standard refers to ISO/IEC 646:1991. With regard to letters, digits, and special characters of the Fortran character set, ISO/IEC 646:1991 and ANSI X3.4-1986, which is the US national vers;on of the ISO /IEC standard, are identical. An ASCII character is encoded by 7 bits. Therefore, a standard ASCII character set contains a total number of 128 characters. The first 32 characters (hex 00 to hex IF) of the ASCII character set are control characters and graphic characters. Nearly all other characters (hex 20 to hex 7E) are printable characters. A-2 _____________ Character Sets and Collating Sequences b7 0 0 1 1 b6 0 0 1 1 0 0 1 1 0 0 011 011 b5 01 1 01 1 1 1 Bits Control Symbols, Upper-case Lower-case b4 b3 b2 b1 Characters Digits Letters Letters 0 16 32 48 G4 80 9G 112 0 0 0 0 NUL DLE SP 0 @ P 0 o 10 20 20 40 30 GO 40 100 50 120 GO 140 70 P 1GO 1 17 33 49 G5 81 97 113 0 0 0 1 SOH DC1 ! 1 A Q a q 1 1 11 21 21 41 31 G1 41 101 51 121 G1 141 71 1G1 2 18 34 50 GG 82 98 114 0 0 1 0 STX DC2 " 2 B R b r 2 2 12 22 22 42 32 G2 42 102 52 122 G2 142 72 162 3 19 35 51 G7 83 99 115 0 0 1 1 ETX DC3 # 3 C S c S 3 3 13 23 23 43 33 G3 43 103 53 123 G3 143 73 IG3 4 20 3G 52 G8 84 100 11G 0 1 0 0 EOT DC4 $ 4 D T d t 4 4 14 24 24 44 34 G4 44 104 54 124 G4 144 74 1G4 5 21 37 53 G9 85 101 117 0 1 0 1 ENQ NAK % 5 E U e u 5 [) 15 25 25 45 35 G5 45 105 55 125 G5 145 75 1135 0 22 38 54 70 80 102 118 0 1 1 0 ACK SYN & 6 F V f v 0 o 10 20 20 40 3G 00 40 100 56 120 00 140 70 160 7 23 39 , [)5 71 87 103 119 0 1 1 1 BEL ETB 7 G W W 7 7 17 27 27 47 37 07 47 107 57 127 07 9 147 77 107 8 24 40 50 72 88 104 120 1 0 0 0 BS CAN ( 8 H X h x 8 10 18 30 28 50 38 70 48 110 58 130 08 150 78 170 D 25 41 57 73 89 105 121 1 0 0 1 HT EM ) 9 1 Y i 9 11 19 31 29 51 39 71 49 111 59 131 09 151 79 Y 171 10 20 42 58 74 90 100 122 1 0 1 0 LF SUB * J Z j Z A 12 1A 32 2A 52 3A 72 4A 112 5A 132 GA 152 7A 172 11 27 43 59 75 91 107 123 1 0 1 1 VT ESC , K [ k { B 13 18 33 2B + 53 38 73 4B 113 58 133 OB 153 7B 173 12 28 44 00 7G D2 108 124 1 1 0 0 FF FS , L I C 14 1C 34 2C 54 3C < 74 4C 114 5C \ 134 OC 154 7C I 174 13 20 45 01 77 93 100 125 1 1 0 1 CR GS - M ] m } D 15 1D 35 2D 55 3D = 75 4D 115 5D 135 OD 155 7D 175 14 30 4G G2 78 94 110 120 1 1 1 0 SO RS > N A n rv E 10 IE 30 2E 50 3E 7G 4E 110 5E 130 OE 150 7E 170 15 31 47 03 79 95 111 127 1 1 1 1 SI US / ? 0 0 DEL F 17 IF 37 2F 57 3F 77 4F 117 5F - 137 GF Hi7 7F 177 The IACHAR intrinsic function returns for a given character the position of this character in the ASCII collating sequence; IACHAR('X') returns the integer value 88. And the ACHAR intrinsic function returns for a given nonnegative integer value the character that corresponds to this given value in the ASCII collating sequence; ACHAR(88) returns the character 'X'. The intrinsic functions LGE, LGT, LLE, and LLT perform lexical comparisons of character strings on the basis of the ASCII collating sequence. Models for Numbers ___________________ B-1 B MODELS FOR NUMBERS The bit manipulation intrinsic subprograms, the numeric manipulation intrinsic functions, and the inquiry intrinsic functions are defined in terms of models for the representation of each kind of integer, real, or double precision real data implemented by the processor. These models are used to describe the charac­ teristics and the behaviour of the corresponding number sets of a particular type. A model has parameters which are chosen by the Fortran processor such that the model best fits the hardware. Note that these models do not dictate to the Fortran processor how it has to implement numbers and how they should behave, but the internal representation and the behaviour of the actually implemented numbers are described in terms of these (abstract) models. B.1 Models for Integers The models for integer data i are defined by: q i = s x l: Wk x r k - 1 k=l with Value Description s +1 or -1 sign r integer > 1 base q integer > 0 max. number of digits Wk each an integer with 0 ::; Wk < r digit The parameters r and q ~etermine the set of value~ of the integer model numbers. ~ Example: For model z = s X l:~~l Wk X 2k- 1 IS q = 31 and r = 2. ~ B.2 Models for Reals The models for real data x are defined by: B-2 ____________________ Models for Numbers with Value Description 8 +1 or -1 sign b integer > 1 base P integer> 1 max. number of digits fk each an integer with 0 S ik < b, digit but h > 0 e integer with emin S e S emax exponent The parameters b, p, emin, and emax determine the set of values of the (real) floating point model numbers. Example: For model x = {O e (/ ,,24 f -k) 8 X 2 x 1 2 + L..Jk=2 k X 2 ,-126 S e S 127 is b = 2, p = 24, emin = -126, and emax = 127. B.3 Models for Bit Manipulation Bit manipulations are performed on integer data. Therefore, a bit is defined as a binary digit w at position k of a nonnegative integer datum. The models for these integers are defined by: 5-1 j = :L Wk X 2k k=O with Value Description 8 integer > 0 maximal number of digits Wk each either 0 or 1 digit, bit The parameter 8 determines the set of values. Example: For model j = L~;O Wk X 2k is 8 = 32. It defines a model for integer data with 32 bits. The models for bit manipulation define that the integer datum is a sequence of 8 bits, which are numbered from the right to the left beginning with 0 for the rightmost bit and ending with (8 - 1) for the leftmost bit. These models apply only to the intrinsic subprograms for bit manipulation and bit inquiry. For all other purposes, the "normal" models for integer data must be used. Decremental Language Features _________________ (-1 C DECREMENTALFEATURES C.l Deleted Language Features The following deleted language features are not included in the normative part of the standard document but in its informative appendix.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages18 Page
-
File Size-