Datasheet

ARITHMETIC OPERATORS
Arithmetic operators are used to perform mathematical computations. They have
numerical operands and return numerical results. The type char technically repre-
sents small integers, so the char variables can be used as operands in arithmetic
operations.
All arithmetic operators associate from left to right.
Arithmetic Operators Overview
Note: Operator * is context sensitive and can also represent the pointer reference
operator.
Binary Arithmetic Operators
Division of two integers returns an integer, while remainder is simply truncated:
195
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroC PRO for AVR
CHAPTER 5
Operator Operation Precedence Type
Binary Operators
+ addition 12
- subtraction 12
* multiplication 13
/ division 13
%
modulus operator returns the remainder of inte-
ger division (cannot be used with floating points)
13
Unary Operators
+ unary plus does not affect the operand 14
- unary minus changes the sign of the operand 14
++
increment adds one to the value of the operand.
Postincrement adds one to the value of the
operand after it evaluates; while preincrement
adds one before it evaluates
14
--
decrement subtracts one from the value of the
operand. Postdecrement subtracts one from the
value of the operand after it evaluates; while pre-
decrement subtracts one before it evaluates
14