Considering .EQV. as == for booleans is more or less correct: a .eqv. b is true if a and b are either both true or both false, and it would result in false otherwise. Most modern Fortran compilers will squawk if either a or b isn't a boolean (Fortran logical), so a fragment like
will cause a compile-time error, which is, on the whole, probably a good thing. As I said in my original post, I've been programming Fortran for quite a few years and never found a use for .eqv. or .neqv.. As an aside, Fortran is insensitive to case; I tend to use uppercase for Fortran keywords and lowercase for everything else.logical boole integer int int = 42 boole = .TRUE. write(*,*) 'is int .eqv. boole true?', int .eqv. boole
In reply to Re^2: Hints Towards Writing a Module with New Operators
by swampyankee
in thread Hints Towards Writing a Module with New Operators
by swampyankee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |