Print

Print


> In point of fact, I'll remind you that Digital/Compaq(/HP)
> Fortran for Alpha does indeed store .false. as 0 and .true.
> as ~0 (or -1 for those still thinking in two's complement),
> and uses even/odd as the testing method.  And they are easily
> converted to - and ~0/-1; as another poster said, these are
> just bit patterns and they take on "value" when you impose an
> interpretation on them.  They aren't the right values or the
> wrong values for anything, until you declare the consistent
> context which imposes an interpretation.  What's your context
> to claim they are the wrong values?
>

I think you'll find that the even/odd testing goes back to the Vaxs (or
earlier) where INTEGERs could be used interchangeably with LOGICALs, and
status codes could be coded as odd numbers for failure and even for
success. So you would use "IF (status)" to test for success, where
status could be any one of many possible values treated as either .true.
or .false..

What a nightmare. It reminds me of the Microsoft gem "IsIconic(hWnd)"
which was at one time a boolean function returning TRUE, FALSE, or -1
for an error, ie invalid hWnd.

The proper definition of a logical data type is a big plus for Fortran.
Program by the standard and you never have to worry about the underlying
implementation. It really does not matter.

Cheers
Simon.