High-level Programming Language (Pascal)
Arithmetic Expressions in Pascal
|
Mathematical
Operator
|
Pascal
Operator
|
Operation
|
Example
|
Result
|
|
+
|
+
|
Addition |
3+2
|
5
|
|
-
|
-
|
Subtraction |
3-2
|
1
|
|
-
|
-
|
Unary Minus |
-3
|
-3
|
|
¡Ñ
|
*
|
Multiplication |
3*2
|
6
|
|
¡Ò
|
/
|
Real Division |
5/2
|
2.5
|
|
¡Ò
|
div
|
Integer Division |
5
div 2
|
2
|
|
mod
|
mod
|
Modulo (remainder) |
5
mod 2
|
1
|
|
Level
of Precedence
|
Arithmetic
Operator
|
|
highest
|
(
)
|
|
high
|
-
(unary minus)
|
|
low
|
*,
/, mod, div
|
|
lowest
|
+,
- (subtraction)
|