f$Abs
f$Abs
Calculate the absolute value of a number or expression.
Syntax: | Value = f$Abs( number ) | ||
| Argument | Type | Meaning |
| Number | Decimal | Number (or expression) from which the absolute value is to be calculated |
Result: | Decimal | Absolute value calculated | |
Example: | PosValue = f$Abs( -2 ) → PosValue = 2 | ||
This function can also be used for integer parameters thanks to automatic type conversion.
The calculation of the function value corresponds to how the following decision table is executed (with a argument named "number’, type decimal):
DT "Abs":
|
| R 01 | ELSE |
B 01 | Number | < 0 |
|
B 02 |
|
|
|
A 01 |
| return( - number ) | return ( number ) |