mikroC

mikroC - C Compiler for Microchip PIC microcontrollers

making it simple...

Arithmetic Operators

Arithmetic operators are used to perform mathematical computations. They have numerical operands and return numerical results. Type char technically represents small integers, so char variables can used as operands in arithmetic operations.

All of arithmetic operators associate from left to right.

Operator

Operation

Precedence

 

 

 

+

addition

12

 

 

 

-

subtraction

12

 

 

 

*

multiplication

13

 

 

 

/

division

13

 

 

 

%

returns the remainder of integer division (can-

13

not be used with floating points)

 

 

 

 

 

+ (unary)

unary plus does not affect the operand

14

 

 

 

- (unary)

unary minus changes the sign of operand

14

 

 

 

++

increment adds one to the value of the

14

operand

 

 

 

 

 

--

decrement subtracts one from the value of the

14

operand

 

 

 

 

 

Note: Operator * is context sensitive and can also represent the pointer reference operator. See Pointers for more information.

page

 

102

MikroElektronika: Development tools - Books - Compilers