Re: Trying to use a logical as an array index
- From: Charles Coldwell <coldwell@xxxxxxxxx>
- Date: Sun, 13 Jul 2008 12:06:40 GMT
"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
.
- Follow-Ups:
- Re: Trying to use a logical as an array index
- From: James Giles
- Re: Trying to use a logical as an array index
- From: James Van Buskirk
- Re: Trying to use a logical as an array index
- References:
- Trying to use a logical as an array index
- From: ferrad
- Re: Trying to use a logical as an array index
- From: ferrad
- Re: Trying to use a logical as an array index
- From: dpb
- Re: Trying to use a logical as an array index
- From: James Van Buskirk
- Re: Trying to use a logical as an array index
- From: dpb
- Re: Trying to use a logical as an array index
- From: James Van Buskirk
- Re: Trying to use a logical as an array index
- From: James Giles
- Re: Trying to use a logical as an array index
- From: James Van Buskirk
- Re: Trying to use a logical as an array index
- From: James Giles
- Trying to use a logical as an array index
- Prev by Date: Re: how to convert variable name to a string?
- Next by Date: Re: rpc's comments on Fortran 2008, part 3
- Previous by thread: Re: Trying to use a logical as an array index
- Next by thread: Re: Trying to use a logical as an array index
- Index(es):