Mikroelektronika MIKROE-742 데이터 시트
![Mikroelektronika](https://files.manualsbrain.com/attachments/e0529b3b58069a916ad7bb89f7e9f5f0eda73421/common/fit/150/50/1b07b99aa3112e022a916b06db07f1f4f211e91d41878452d87c7638b1bf/brand_logo.gif)
Operators Precedence and Associativity
There are 4 precedence categories in mikroPascal PRO for AVR. Operators in the same
category have equal precedence with each other.
category have equal precedence with each other.
Each category has an associativity rule: left-to-right (
), or right-to-left (
). In the
absence of parentheses, these rules resolve the grouping of expressions with operators
of equal precedence.
of equal precedence.
Arithmetic Operators
Arithmetic operators are used to perform mathematical computations. They have numer-
ical operands and return numerical results. Since the char operators are technically bytes,
they can be also used as unsigned operands in arithmetic operations.
ical operands and return numerical results. Since the char operators are technically bytes,
they can be also used as unsigned operands in arithmetic operations.
All arithmetic operators associate from left to right.
156
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroPASCAL PRO for AVR
CHAPTER 5
Precedence Operands Operators
Associativity
4
1
@ not + -
3
2
* / div mod and shl shr
2
2
+ - or xor
1
2
= <> < > <= >=
Operator
Operation
Operands
Result
+
addition
byte, short, word,
integer, longint,
dword, real
integer, longint,
dword, real
byte, short,word,
integer, longint,
dword, real
integer, longint,
dword, real
-
subtraction
byte, short, word,
integer, longint,
dword, real
dword, real
byte, short,word,
integer, longint,
dword, real
dword, real
*
multiplication
byte, short, word,
integer, longint,
dword, real
dword, real
word, integer,
longint, dword,
real
real
/
division, floating-point
byte, short, word,
integer, longint,
dword, real
real
div
division, rounds down
to nearest integer
to nearest integer
byte, short, word,
integer, longint,dword
byte, short,
word, integer,
word, integer,
longint, dword
mod
modulus, returns the
remainder of integer
division (cannot be
used with floatin points)
remainder of integer
division (cannot be
used with floatin points)
byte, short, word,
integer, longint,
integer, longint,
dword
byte, short,
word, integer,
word, integer,
longint, dword