To: J3 08-118r2 From: Malcolm Cohen Subject: UTI 149, INT/REAL with boz argument Date: 2008 February 13 1. Introduction Too much of INT(boz) has become processor dependent (more than in F2003). In addition, the description needs to be modified to take into account the padding and truncation of the boz argument that might take place. The padding and truncation modification is also needed for REAL. 2. Further considerations The literal meaning of "if its value were the bit pattern" is "if false". False implies anything, so it specifies nothing. Also, truncating a bit sequence to fit it into the result is likely going to produce an unexpected and inadvertant value. There are valid uses for INTEGER but it is surely a mistake for REAL, and should be disallowed. Also, padding a bit sequence to fit it into the result is only likely to be harmless for INT (even there it will be harmful if the user was intending to set the most significant bit and miscounted the number of digits). We should consider disallowing this as well. Fortran 2003 did not establish interpretations for these cases so we have a free hand in ruling out obvious mistakes. 3. Edits to J3/08-007: In 13.3.3, index "padding" and "truncation" as definitions. [345:31+] New paragraph with constraint: "C13aa If a \si{boz-literal-constant} is truncated as an argument to the intrinsic function REAL, the discarded bits shall all be zero." {Prevents user initialization mistakes.} [390:33-36] Replace case (iv) of the Result Value section of 13.7.81 INT(A [,KIND]) with "If A is a \si{boz-literal-constant}, the value of the result is the value whose bit sequence according to the model in \ref{D13:Bit model} is the same as that of A as modified by \mindex*{padding} or \mindex*{truncation} according to \ref{D13:Bit sequences as arguments to INT and REAL}. The interpretation of a bit sequence whose most significant bit is 1 is processor dependent." [416:24-27] Replace case(iii) of the Result Value section of 13.7.136 REAL(A [,KIND]) with "If A is a \si{boz-literal-constant}, the value of the result is the value whose internal representation as a bit sequence is the same as that of A as modified by \mindex*{padding} or \mindex*{truncation} according to \ref{D13:Bit sequences as arguments to INT and REAL}. The interpretation of the bit sequence is processor dependent." ===END===