The following operators are arithmetic operators:
Operator sign | Description |
+ | The operator results in the sum of two operands. |
- | The operator results in the difference between two operands. |
* | The operator results in the product of two operands. |
/ | The operator results in the quotient of two operands. |
Div | The operator results in the integer part of two operands division. |
Mod | The operator results in the remainder of two operands division. |
Operators can be applied to various types of operands. The result type is determined by operand type. If the / operator exists in the expression, the type of the returned expression is real. On executing MOD and DIV operators for real data operands the result will be of the real data type.
Sub ArithmeticSample();
Var
d: double;
f: float;
i: integer;
Begin
i := integer.MaxValue;
f := i + i;
d := f / i;
i := i Mod i;
d := d Mod f;
d := f Div d;
End Sub;
See also:
Fore.NET Language Guide | Unary Operators | Logical Operators