Fortran (Formula Translation) is a popular programming language commonly used in scientific and engineering applications.
In Fortran, operators are symbols or characters that perform various operations on data, such as arithmetic calculations, logical comparisons, and bitwise operations.
Here are the main operators available in Fortran:
- Arithmetic Operators:
- Addition:
+ - Subtraction:
- - Multiplication:
* - Division:
/ - Exponentiation:
**(e.g.,x**2raisesxto the power of 2)
- Addition:
- Comparison Operators:
- Equality:
== - Inequality:
/= - Greater than:
> - Less than:
< - Greater than or equal to:
>= - Less than or equal to:
<=
- Equality:
- Logical Operators:
- Logical AND:
.AND. - Logical OR:
.OR. - Logical NOT:
.NOT.
- Logical AND:
- Bitwise Operators:
- Bitwise AND:
AND - Bitwise OR:
OR - Bitwise Exclusive OR (XOR):
XOR - Bitwise NOT:
NOT
- Bitwise AND:
- Assignment Operator:
- Assignment:
=
- Assignment:
- Miscellaneous Operators:
- Concatenation:
//(used to concatenate strings) - Membership:
IN(checks if a value is in a specified list) - Pointer Assignment:
=>(used for pointer assignments in Fortran 90 and later versions)
- Concatenation:
These operators can be used in Fortran expressions to manipulate and compare values, control program flow, and perform various calculations.
It’s important to note that operator precedence rules apply in Fortran, which determine the order in which operators are evaluated within an expression.