Re: printing logical variables as "true" and "false"
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Mon, 28 Nov 2005 20:14:11 -0800
Richard Maine wrote:
You appear to be assuming things that the standard quite explicitly does not guarantee. Specifically, you appear to be assuming that the compiler's internal representation of .true. and .false. are the same as the internal representations of the integers 0 and 1. This is *NOT* a standard-conforming assumption and there have been plenty of compilers where it was not the case. It might happen to work on a particular collection of compilers; that might even happen to be most current ones - I haven't checked. But I sure know that it isn't an assumption justified by the standard.
It is 0 and -1 on the TOPS-10 Fortran compiler, and it would also convert between logical and integer, such that a logical expression would have the value 0 or -1.
-- glen
.
- References:
- printing logical variables as "true" and "false"
- From: beliavsky
- Re: printing logical variables as "true" and "false"
- From: Richard E Maine
- Re: printing logical variables as "true" and "false"
- From: *** Hendrickson
- Re: printing logical variables as "true" and "false"
- From: Richard E Maine
- Re: printing logical variables as "true" and "false"
- From: Richard E Maine
- Re: printing logical variables as "true" and "false"
- From: *** Hendrickson
- Re: printing logical variables as "true" and "false"
- From: James Van Buskirk
- Re: printing logical variables as "true" and "false"
- From: Nestor Grion
- Re: printing logical variables as "true" and "false"
- From: Richard Maine
- printing logical variables as "true" and "false"
- Prev by Date: Re: printing logical variables as "true" and "false"
- Next by Date: Re: printing logical variables as "true" and "false"
- Previous by thread: Re: printing logical variables as "true" and "false"
- Next by thread: Re: printing logical variables as "true" and "false"
- Index(es):