Ticker

6/recent/ticker-posts

Header Ads Widget


 

Operators

Operators


The predefined operators in the language are classified into the following five categories:

1. Logical operators

2. Relational operators

3. Adding operators

4. Multiplying operators

                        5. Miscellaneous operators

  • Logical Operators

The six logical operators are

And   or   nand   nor   xor    not

These operators are defined for the predefined types BIT and BOOLEAN.

 

  • Relational Operators

These are

=    /=    <    <=     >     >=

The result types for all relational operations is always BOOLEAN. The = (equality) and the /= (inequality) operators are permitted on any type except file types.

 

  • Adding Operators

These are

+                  -                 &

The operands for the + (addition) and - (subtraction) operators must be of the same numeric type with the result being of the same numeric type.

 

  • Multiplying Operators 
         These are

·              /              mod               rem

The * (multiplication) and / (division) operators are predefined for both operands being of the same integer or floating point type. The result is also of the same type.

 

  • Miscellaneous Operators

 The miscellaneous operators are

Abs                  **

The abs (absolute) operator is defined for any numeric type.

The ** (exponentiation) operator is defined for the left operand to be of integer or floating point type and the right operand (i.e., the exponent) to be of integer type only.

 

 

Post a Comment

0 Comments