Re: printing logical variables as "true" and "false"
- From: Paul Van Delst <Paul.vanDelst@xxxxxxxx>
- Date: Tue, 29 Nov 2005 11:44:35 -0500
Nestor Grion wrote:
Hello In Matlab:
F => 0 T => 1
0 => F else => T
Slightly off topic, but in IDL:
F => Zero and even values (e.g. -4, -2, 0, 2, 4, etc) T => Odd non zero values (e.g. -3, -1, 1, 3, 5, etc)
(which I can't stand, btw.)
I much prefer the Fortran logicals .true. and .false. It's quite clear what it means. 0 and 1 have different meanings in different contexts/languages, e.g. "exit 0" from a Bourne shell script is a good result, whereas "exit 1" (or some other integer) flags an error. By the logic where F=>0 and T=>1, I would think that "exit 0" == "exit false" and it indicates an error. With Fortran I don't have to worry about that.
cheers,
paulv
-- Paul van Delst CIMSS @ NOAA/NCEP/EMC .
- Follow-Ups:
- Re: printing logical variables as "true" and "false"
- From: James Van Buskirk
- Re: printing logical variables as "true" and "false"
- 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
- Re: printing logical variables as "true" and "false"
- From: Ron Shepard
- Re: printing logical variables as "true" and "false"
- From: David Flower
- Re: printing logical variables as "true" and "false"
- From: Nestor Grion
- printing logical variables as "true" and "false"
- Prev by Date: Re: Good book on fortran 90/95
- Next by Date: Re: Polynomial fitting routines?
- Previous by thread: Re: printing logical variables as "true" and "false"
- Next by thread: Re: printing logical variables as "true" and "false"
- Index(es):