- Rexx Tutorial
- Rexx - Home
- Rexx - Overview
- Rexx - Environment
- Rexx - Installation
- Rexx - Installation of Plugin-Ins
- Rexx - Basic Syntax
- Rexx - Datatypes
- Rexx - Variables
- Rexx - Operators
- Rexx - Arrays
- Rexx - Loops
- Rexx - Decision Making
- Rexx - Numbers
- Rexx - Strings
- Rexx - Functions
- Rexx - Stacks
- Rexx - File I/O
- Rexx - Functions For Files
- Rexx - Subroutines
- Rexx - Built-In Functions
- Rexx - System Commands
- Rexx - XML
- Rexx - Regina
- Rexx - Parsing
- Rexx - Signals
- Rexx - Debugging
- Rexx - Error Handling
- Rexx - Object Oriented
- Rexx - Portability
- Rexx - Extended Functions
- Rexx - Instructions
- Rexx - Implementations
- Rexx - Netrexx
- Rexx - Brexx
- Rexx - Databases
- Handheld & Embedded
- Rexx - Performance
- Rexx - Best Programming Practices
- Rexx - Graphical User Interface
- Rexx - Reginald
- Rexx - Web Programming

- Rexx Useful Resources
- Rexx - Quick Guide
- Rexx - Useful Resources
- Rexx - Discussion

An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations.

Rexx has various types of operators which are also explained in detail as follows −

- Arithmetic operators
- Relational operators
- Logical operators
- Bitwise operators

The Rexx language supports the normal Arithmetic Operators as any the language. Following are the Arithmetic Operators available in Rexx.

Operator | Description | Example |
---|---|---|

+ | Addition of two operands | 1 + 2 will give 3 |

− | Subtracts second operand from the first | 1 - 2 will give -1 |

∗ | Multiplication of both operands | 2 ∗ 2 will give 4 |

/ | Division of numerator by denominator | 2 / 2 will give 1 |

// | Remainder of dividing the first number by the second | 3 // 2 will give 1 |

% | The div component will perform the division and return the integer component. | 3 % 2 will give 1 |

Relational Operators allow of the comparison of objects. Following are the relational operators available in Rexx. In Rexx the true value is denoted by 1 and the false value is denoted by 0.

Operator | Description | Example |
---|---|---|

== | Tests the equality between two objects | 2 = 2 will give 1 |

< | Checks to see if the left object is less than the right operand. | 2 < 3 will give 1 |

=< | Checks to see if the left object is less than or equal to the right operand. | 2 =< 3 will give 1 |

> | Checks to see if the left object is greater than the right operand. | 3 > 2 will give 1 |

>= | Checks to see if the left object is greater than or equal to the right operand. | 3 > 2 will give 1 |

Logical Operators are used to evaluate Boolean expressions. Following are the logical operators available in Rexx.

Operator | Description | Example |
---|---|---|

& | This is the logical “and” operator | 1 or 1 will give 1 |

| | This is the logical “or” operator | 1 or 0 will give 1 |

\ | This is the logical “not” operator | \0 will give 1 |

&& | This is the logical exclusive “or” operator | 1 && 0 will give 1 |

Groovy provides four bitwise operators. Below are the bitwise operators available in Groovy.

Sr.No. | Operator & Description |
---|---|

1 |
This is the bitwise “and” operator |

2 |
This is the bitwise “or” operator |

3 |
This is the bitwise “xor” or Exclusive or operator |

The following table shows the Operator Precedence for the Rexx operators in order of descending priority of their precedence.

Operators | Precedence |
---|---|

Prefix operators | + - \ |

Addition and subtraction | + - |

Comparison operators | = == > < >= <= |

Logical AND | & |

Logical OR | | |

EXCLUSIVE OR | && |

Advertisements