CALCULATE

LANSA Composer

CALCULATE

This activity performs a simple arithmetic calculation, given an operator and two operands.  It is intended for simple calculations, usually using integer values.  The calculation for the modulo (remainder) operator assumes integer values are specified.

All calculations are performed using a precision of 30,9.  If any inputs or intermediate or final results exceed the number of significant or decimal digits, then loss of precision will result without warning or error.

Note:  Intensive calculations, especially when relating to application data (as opposed to variables that control the process orchestration) should be done in compiled code units (such as custom activities, Java or IBM i 3GL programs or LANSA functions) that are called from the processing sequence.

INPUT Parameters:

NUMBERIN1 : Required

This parameter specifies the first operand for the calculation.  The value specified must be numeric.

OPERATOR : Required

This parameter must specify the arithmetic operator to be used for the calculation.  You must specify one of the following values:

+  (addition)
-  (subtraction)
*  (multiplication)
/  (division)
%  (modulo, remainder)

NUMBERIN2 : Required

This parameter specifies the second operand for the calculation.  The value specified must be numeric.  Further, for operators / and % (division and modulo operations), the value cannot be zero.

OUTPUT Parameters:

NUMBEROUT :

Upon successful completion, this output parameter contains the result of the specified calculation.