You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
3.5. EXPRESSIONS FOR INPUT CONTROL PARAMETERS 69<br />
3.5.5 Simple Arithmetic Operations<br />
Table 3.9 shows an overview of the available simple arithmetic operations.<br />
All operations are left-associative, except the right-associative unary minus operator. The evaluation<br />
usually is done from left to right. However, parentheses can change the order of evaluation<br />
and some operators have a higher precedence than others (see chapter 3.5.14).<br />
» division<br />
multiplication<br />
Ú · Ú addition and concatenation of strings<br />
¹ subtraction<br />
¹ negation<br />
Table 3.9: Arithmetic operations<br />
The arithmetic operations in <strong>HDevelop</strong> match the usual definitions. Expressions can have any<br />
number of parentheses.<br />
The division operator ( » ) can be applied to ÒØÖ as well as to ÖÐ. The result is of<br />
type ÖÐ, if at least one of the operands is of type ÖÐ. If both operands are of type ÒØÖ<br />
the division is an integer division. The remaining arithmetic operators (multiplication, addition,<br />
subtraction, and negation) can be applied to either ÒØÖ or ÖÐ numbers. If at least one<br />
operand is of type ÖÐ, the result will be a ÖÐ number as well. In the following example.<br />
ν »¿<br />
ξ »¿º¼<br />
ο ´»¿µ ¾º¼<br />
ν is set to 1, ξ to 1.3333333, and ο to 2.0. Simple examples can be found in the program<br />
ÖØÑغÚ.<br />
3.5.6 Bit Operations<br />
This section describes the operators for bit processing of numbers. The operands have to be<br />
integers.<br />
Ð×´¸µ<br />
Ö×´¸µ<br />
Ò <br />
ÓÖ <br />
ÜÓÖ <br />
ÒÓØ <br />
left shift<br />
right shift<br />
bitwise and<br />
bitwise or<br />
bitwise xor<br />
bitwise complement<br />
Table 3.10: Bit operations<br />
The result of Ð×´½¸¾µ is a bitwise left shift of ½ that is applied ¾ times. If there is no<br />
overflow this is equivalent to a multiplication by ¾ ¾ . The result of Ö×´½¸¾µ is a bitwise<br />
HALCON 6.0