| Refresh | Home EGTry.com

arithmetic and logical operator in fortran


higher precedence operators list first


exponentiation **, right-to-left associativity

-2**2**3
same as
-2**(2**3)



unary operator, + for positive and - for negative

+3
+3.1
-5
-0.5



multiplication * and division /

4/2
4*2
4.3*1.1
-5/2.5



addition + and subtraction -

4*5+3
4-5



comparison

operator meaning
.eq. =
.nq. !=
.gt. >
.lt. <
.ge. >=
.le. <=


logical negation

 .not.


logical and

 .and.


logical or

 .or.