J3/01-292
Subject: Revised answer for Interp F90/207
From: Malcolm Cohen
To: J3
Date: 6th August 2001
----------------------------------------------------------------------
NUMBER: F90/000207
TITLE: Integer bit-model inconsistency
KEYWORDS: Bit manipulation procedures, models for integer data
DEFECT TYPE:
STATUS: J3 consideration in progress
QUESTION: Is the following observation true?
[F90 185:last sentence of 13.5.7] and [WG5/N1176, 219:22+] says
``In particular, whereas the models are identical for w_{z-1}=0,
they do not correspond for w_{z-1}=1 and ...''
This statement assumes r==2 in the model for integer data defined in
13.7.1, it is not true for general r. The above sentence should be
changed to something like
``In particular, whereas the models are identical for r=2 and
w_{z-1}=0, they do not correspond for r/=2 or w_{z-1}=1, and ...''
ANSWER: Yes.
DISCUSSION:
If the radix is 10 (e.g. for BCD machines) it is simply not possible for the
models to be the same. For a 2-digit BCD machine, the 13.7.1 model gives a
number range of ñ99; ignoring the (irrelevant) negative numbers, the bit
model
either has more numbers (128) or fewer numbers (64) than the BCD model
(100).
Given this irreconcilable incompatibility, it is best to let the bit
intrinsics
manipulate the bits and not attempt to pretend that the models can ever
match.
This allows bit manipulation to be efficient on such machines, but loses the
connection between the "normal" value and the "bit" value (which must be at
least partially lost no matter how inefficient we make it).
EDIT:
[219:23] Insert "r=2 and" at the beginning of the line, and
Insert "r/=2 or" after "for" (where "/=" is the "not equal"
symbol).
SUBMITTED BY: Michael Hennecke (hennecke@rz.uni-karlsruhe.de)
HISTORY: submitted Mar. 12, 1996 (first appeared in 96-006r2)
WG5/N1404 Draft answer
00-260 m154 Passed by J3 meeting
00-329 m155 Failed J3 letter ballot
WG5/N1452 Suggested revision.
158-mjc-008 m158
----------------------------------------------------------------------