Re: Trying to use a logical as an array index



"James Giles" <jamesgiles@xxxxxxxxxxxxxxxx> writes:


transfer(IAND(-1,NOT(transfer(.TRUE._C_BOOL,1))),.TRUE._C_BOOL)

I want to ask a more basic question about this (James van Buskirk's)
code. Why

IAND(-1, ...)

?

IIUC,

transfer(.TRUE._C_BOOL,1)

is of type default integer, so that

NOT(transfer(.TRUE._C_BOOL,1))

is also of type default integer. -1 is certainly of type default
integer, and on a 2s-complement machine, bitwise-and of -1 with
anything is a no-op. In other words, I think

IAND(-1,NOT(transfer(.TRUE._C_BOOL,1)))

and

NOT(transfer(.TRUE._C_BOOL,1))

should always be the same type and value. Am I wrong?

Chip

--
Charles M. "Chip" Coldwell
"Turn on, log in, tune out"
GPG Key ID: 852E052F
GPG Key Fingerprint: 77E5 2B51 4907 F08A 7E92 DE80 AFA9 9A8F 852E 052F
.