Difference between .eq. and ==

Viewed 5634

I see that a similar question exists for JSP but I don't see a StackOverflow question for Fortran.

The question is: what is the difference between the comparison operators ".eq." and "==" in Fortran?

Note that since I use multiple versions of Fortran (77 and 90 mostly) I'd be interested in knowing if this has changed across versions or at least to what version your answer is in regards to.

Also, since I've only been able to find tutorials on google, it would be great if you could reference something authoritative in your answer (though I'm not sure if a Fortran manual exists online).

Speaking of which, this is what I've found from tutorial pages: this tutorial page http://www.personal.psu.edu/jhm/f90/lectures/10.html seems to indicate there is no difference between them, while this set of slides http://www.cs.mtu.edu/~shene/COURSES/cs201/NOTES/F90-Control.pdf seems to indicate that "==" is for string comparison while ".eq." is for complex values.

EDIT: Actually, the second hyperlink doesn't mention " .eq. " at all. In any case Alexander Vogt's answer is exactly what I was looking for.

1 Answers
Related