int/2—truncate a numeric value to an integer value
The int/2 primitive truncates a numeric value to an integer value.
$INTVAL=int($NUMBER)
int/2 arguments
Argument | Mode | Type | Description |
---|---|---|---|
$NUMBER | Input | INTEGER|REAL | Specifies the numeric (integer or real) value that is to be converted to an integer |
$INTVAL | Output | INTEGER | The conversion result, returned as an integer |
Use int/2 to convert the numeric value specified by the $NUMBER argument to an integer value returned in the $INTVAL argument. The conversion truncates the $NUMBER value to the largest integer value that is smaller than or equal to it.
The following statement is true for the truncation process:
"X: X-1 < int(X) £ X
int/2 example
$DEV = int( ( $AVERAGE_DURATION - real($E.duration) ) ^ 2 );
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*