For Programmers: Free Programming Magazines  


Home > Archive > Fortran > November 2005 > Re: printing logical variables as "true" and "false"









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: printing logical variables as "true" and "false"
Ron Shepard

2005-11-29, 3:58 am

In article <1h6r61b.1dl9q5f1btrvlsN%nospam@see.signature>,
nospam@see.signature (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.


However, in hindsight things would sure have been easier over the
past 25 years if the standard did specify this kind of mapping. Or
if LOGICAL were treated as a 2-value subset of INTEGER. That way,
you could use logical variables as, for example, array indices,
do-loop indices, and so on.

$.02 -Ron Shepard
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com