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"
Richard Maine

2005-11-29, 3:57 am

Nestor Grion <ngrion@gmail.com> wrote:

> write(*,*) tf(transfer(a,0)), tf(transfer(b,0))


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.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
Sponsored Links







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

Copyright 2008 codecomments.com