![]() ![]() |
|
Help for Process Engine Reference | |
Search | Index | |
![]() |
|
![]() |
![]() |
![]() |
Numeric functionsFollowing are brief descriptions of the functions that apply to float or integer values. For more detailed information about a specific function (such as usage and syntax), click the function name.
absThis function returns the absolute value of an integer or float expression. Use the following syntax: abs (num_expr) where num_exp is an expression whose result is of type integer or float. For example: abs (SalePrice - PurchasePrice)
bitand, bitor, and bitnotThese functions provide boolean manipulation of bits; use them to perform many tasks, such as masking setting, and extracting bits. Each of these functions can perform boolean operations on up to 32 items at the same time. If you are familiar with the 'C' programming language, then bitand, bitor, and bitnot are like logical and (&), logical or (|), and logical not (~), respectively. If you are not familiar with 'C', then consider the numbers to be binary values (e.g., 123 would be 1111011). These functions take integers of 32 bits (that is, from 0 through 42946967295) as input and return integers in the same range as output. Use the following syntax: bitand (expr1, expr2) bitor (expr1, expr2) bitnot (expr) where expr1 and expr2 are integers of 32 bits. For specific information about and examples of each function, select a topic from the list below.
bitandThe bitand function "ands" the corresponding bits in two integers. This is a bit-by-bit comparison, the result of which is output to a new integer. The comparison follows these rules:
For example, bitand (123, 240) can be visualized as follows.
bitorThe bitor function "ors" the corresponding bits in two integers. The result of this bit-by-bit comparison is output to a new integer. The comparison follows these rules:
For example, bitor (123, 240) can be visualized as follows.
bitnotThe bitnot function "nots" an integer; the result of this bit-by-bit analysis is output to a new integer. For each position, the new integer contains the opposite bit value—meaning, for example, that if the input integer contains a 1 in a given position, the new integer contains a 0 in the same position. For example, bitnot (123) can be visualized as follows.
intThis function computes the integer value of a float expression by truncating everything after the decimal point. For example, the float values 6.2 and 6.8 are converted to the integer value 6. The sign of the number does not change. Use the following syntax: int (num_expr) where num_expr is an expression whose result is of type float. For example: int (365 / 7)
modThis function returns the remainder after division (modulus). Note that if you try to divide a value by zero, a runtime error occurs. Use the following syntax: mod (num1, num2) where num1 and num2 are variables of type float or integer, and can contain negative values. In the following example, the function returns the remainder of the division of NumberOfDays by 7. mod (NumberOfDays, 7) Note that the sign of num2 determines the sign of the mod function’s output (when the output is not equal to 0): If num2 > 0,
0 <= mod (num1, num2) < num2 If num2 < 0, num2 < mod (num1, num2) <= 0
randomSome applications need a way to generate a random integer, perhaps as a means of performing random sampling. This function returns a random integer within a specified range. It requires an integer as a parameter to determine the range. Use the following syntax: random (num) where num is an integer from 2 through 32768(inclusive of both ends). The range is between 0 and num - 1. In the above example, if num were 23, the random integer would fall between 0 and 22.
err_encodeThis function converts a three-part FileNet error tuple into a integer value, which you can compare to a result code returned by a call to a WorkFlo Application Libraries (WAL) entry point. WAL returns result codes when when exception conditions in normal processing occur (such as end-of-file in simple data processing), or when errors occur. The primary use for err_encode is to base subsequent processing of a work item on the results returned by an operation that calls WAL. Typically, such an operation is followed by a Branch system Instruction; when the Branch executes, the work item follows the processing path determined by the result code that the previous operation returned. For example, use the err_code function in the Branch definition to indicate that if <return code> = err_encode (80, 0, 2), the work item follows one processing path, while it follows another processing path if <return code> = err_encode (80, 0, 5). Use the following syntax: err_encode (mod_num, func_num, err_num)
|
![]() |
|
![]() |
|