Returns the absolute value of a given number.
| Syntax | abs(<num>) | ||
| Arguments | Name | Type | Description |
<num> | Numeric | The target number | |
| Return Type | UINT | ||
UQLreturn abs(-2.32)
Result:
| abs(-2.32) |
|---|
| 2.32 |
Rounds a given number up to the nearest integer.
| Syntax | ceil(<num>) | ||
| Arguments | Name | Type | Description |
<num> | Numeric | The target number | |
| Return Type | INT | ||
UQLuncollect [-2.92, 4.2] as item return ceil(item)
Result:
| ceil(item) |
|---|
| -2 |
| 5 |
Rounds a given number down to the nearest integer.
| Syntax | floor(<num>) | ||
| Arguments | Name | Type | Description |
<num> | Numeric | The target number | |
| Return Type | INT | ||
UQLuncollect [-2.92, 4.2] as item return floor(item)
Result:
| floor(item) |
|---|
| -3 |
| 4 |
Returns the mathematical constant π (pi) approximately equal to 3.14159. Pi is the ratio of a circle's circumference to its diameter in Euclidean geometry.
| Syntax | pi() |
| Return Type | DOUBLE |
UQLreturn pi()
Result:
| pi() |
|---|
| 3.14159265358979 |
Raises a number to the power of another number.
| Syntax | power(<base>, <exponent>) | ||
| Arguments | Name | Type | Description |
<base> | Numeric | The number to be raised to a power | |
<exponent> | Numeric | The power to which the base is raised | |
| Return Type | DOUBLE | ||
UQLreturn pow(2, 4)
Result:
| pow(2, 4) |
|---|
| 16 |
Returns the nearest value of a given number, rounded to a specified position of digits. If two nearest values are equidistant, it returns the one with the larger absolute value.
| Syntax | round(<num>, [<digit>]) | ||
| Arguments | Name | Type | Description |
<num> | Numeric | The target number to be rounded | |
<digit> | INT | The position of digits to keep:
| |
| Return Type | DOUBLE | ||
UQLreturn round(3.1415926, 3)
Result:
| round(3.1415926, 3) |
|---|
| 3.142 |
Computes the square root of a given number.
| Syntax | sqrt(<num>) | ||
| Arguments | Name | Type | Description |
<num> | Numeric | The target number | |
| Return Type | DOUBLE | ||
UQLreturn sqrt(16)
Result:
| sqrt(16) |
|---|
| 4 |