Returns the absolute value of the argument.
1 math.abs
<math.abs>
<var | exp /> !
</math.abs>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Evar | exp | Numeric | Value or expression. |
Returns | |
---|---|
Type | Description |
number | Natural number. |
Exceptions
abs not valid for type
The type of data of the argument is not numeric.
Example
Obtain the absolute value of a negative integer.
Copy
<xsql-script name='math_abs_sample1'> <body> <println><math.abs>-14</math.abs></println> </body> </xsql-script>
The absolute value fo the integer -14, which would be shown by screen is 14.
Example
Obtain the absolute value of a negative integer contained in a variable.
Copy
<xsql-script name='math_abs_sample2'> <body> <set name='numero'>-14</set> <println><math.abs><numero/></math.abs></println> </body> </xsql-script>
The absolute value of the integer -14, contained in the variable of name 'number' which would be shown by screen, is 14.