08-296r2 To: J3 From: Steve Lionel Subject: Gw and G0.d Formats Date: 2008 November 19 This document supersedes 08-251r3 and incorporates some of the suggestions from N1743. Commenter's Subject was "The g0 edit descriptor" According to the draft document: C1007 (R1006) For the G edit descriptor, d shall be specified if and only if w is not zero. To me this eliminates any value the g0 feature might have. What's needed is something like list-directed output but with the precision controlled by the programmer. For example, in order for an input item to have the same internal value as the original value that was output, the output must generally carry at least 9 digits (for IEEE single precision). If the ability to specify d were present, G would probably become my main output edit descriptor. I was looking forward to g0 before I found that it wasn't allowed a d part. J3's response: J3 agrees that this would be a useful feature. In the original J3 response, 08-251r3, G0.d, like G0, was defined in terms of the ESw.d format, meaning that even values close to zero would be shown in E format, unlike the Gw.d format (for w>0) which would choose F format for such values. N1743 suggested that G0 and G0.d behave more like Gw.d in such cases and J3 agrees. N1743 further proposed that "redundant" characters in the formatted value, such as leading zeros and the plus sign in an exponent, be removed so as to make the result even more compact. J3 feels that this formatting style is unlike any other in Fortran and has chosen the more conservative approach of defining G0 and G0.d in terms of Gw.dEe with the addition of having leading and trailing blanks removed. Edits: [243:1] In 10.3.2, delete "and only if" from C1007 Add new constraint after C1007: "C1007+ (R1006) For the G edit descriptor, shall not be specified if is zero." [253:1] In 10.7.5.1, replace "the external field occupies positions; for real or complex data" with "the external field occupies positions. For real or complex data" [254:2] In 10.7.5.2.2, replace paragraph 2 with: "When used to specify the output of real or complex data that is not an IEEE infinity or NaN, the G0 and G0. edit descriptors follow the rules for the G.E edit descriptor, except that any leading or trailing blanks are removed. Reasonable processor-dependent values of , (if not specified), and are used with each output value." [254:3] In 10.7.5.2.2 paragraph 3, insert after "Fw.d" the following, ", and the form of the output field for the G0 and G0.d edit descriptors is the same as for F0.0." [461] In A2 Processor dependencies, 10th last bullet, change "the field width used for the G0 edit descriptor (10.7.5)" to "the field width, the decimal part width, and the exponent width used for the G0 edit descriptor (10.7.5)".