bm251 Arithmetic Operations

Calculations


 

bm275 add

bm276 subtract

bm277 multiply

bm278 divide

bm279 modulo

bm280 power

 

The arithmetic operations provide the possibility to calculate numeric terms. As operator parameters one or several numeric terms can be given. Operations with operands are carried out gradually from above downwards, the result of a calculation carried out with two operands being used as the first operand for the next calculation. Entering one operand only has a special significance. For one operand only, the difference operator will return the operand's negative value, the quotient operator will return the operand's reciprocal.

 

The modulo operator calculates the rest after dividing the first (positive) operand by the other one. As an example, the term 8 mod 3 will return the value of 2 as the calculation result (= 8 - 3 - 3). For negative numbers supplement of the operand will be used; the term -8 mod 3 will return 1 (= 3 - (8 mod 3) = -8 + 3 + 3 + 3). This operation proves as cutting the number into the interval 0 to second_operand and can be used as e.g. an angle normalization.