Numeric functions perform arithmetic operations and comparisons on numeric values.
add
Details:
| Item | Description |
| Syntax | add(n1, n2) |
| Description | Calculates the sum of two addends. |
| Parameter |
|
| Return value | Returns the sum of n1 + n2. |
| Example | Output:n1=30 n2=-10 n3=200 n4=0.5 n5=15 |
sub
Details:
| Item | Description |
| Syntax | sub(n1, n2) |
| Description | Calculates the difference between two numbers. |
| Parameter |
|
| Return value | Returns the difference of n1 - n2. |
| Example | Output:n1=30 n2=-10 n3=200 n4=0.5 n5=15 |
mul
Details:
| Item | Description |
| Syntax | mul(n1, n2) |
| Description | Calculates the product of two numbers. |
| Parameter |
|
| Return value | Returns the product of n1 × n2. |
| Example | Output:n1=30 n2=-10 n3=200 n4=0.5 n5=15 |
div
Details:
| Item | Description |
| Syntax | div(n1, n2) |
| Description | Calculates the quotient of two numbers. |
| Parameter |
|
| Return value | Returns the quotient of n1/n2. |
| Example | Output:n1=30 n2=-10 n3=200 n4=0.5 n5=15 |
mod
Details:
| Item | Description |
| Syntax | mod(n1, n2) |
| Description | Calculates the remainder after division of one number by another. |
| Parameter |
|
| Return value | Returns the remainder of n1 % n2. |
| Example | Output:n1=30 n2=-10 n3=200 n4=0.5 n5=15 |
gt
Details:
| Item | Description |
| Syntax | gt(n1, n2) |
| Description | Determines whether a number is greater than another one. |
| Parameter |
|
| Return value | If n1 > n2, true is returned. Otherwise, false is returned. |
| Example |
|
ge
Details:
| Item | Description |
| Syntax | ge(n1, n2) |
| Description | Determines whether a number is greater than or equal to another one. |
| Parameter |
|
| Return value | If n1 >= n2, true is returned. Otherwise, false is returned. |
| Example |
|
lt
Details:
| Item | Description |
| Syntax | lt(n1, n2) |
| Description | Determines whether a number is less than another one. |
| Parameter |
|
| Return value | If n1 < n2, true is returned. Otherwise, false is returned. |
| Example |
|
le
Details:
| Item | Description |
| Syntax | le(n1, n2) |
| Description | Determines whether a number is less than or equal to another one. |
| Parameter |
|
| Return value | If n1 <= n2, true is returned. Otherwise, false is returned. |
| Example |
|
floor
Details:
| Item | Description |
| Syntax | floor(n) |
| Description | Generates the greatest integer that is smaller than or equal to a number. |
| Parameter | n: the number to be rounded down. |
| Return value | Returns the greatest integer that is smaller than or equal to the number specified by n. |
| Example |
Request: /path1/path2/file?num=9.3 Response: ceil: 10 floor: 9. |
ceil
Details:
| Item | Description |
| Syntax | ceil(n) |
| Description | Generates the smallest integer that is greater than or equal to a number. |
| Parameter | n: the number to be rounded up. |
| Return value | Returns the smallest integer that is greater than or equal to the number specified by n. |
| Example |
Request: /path1/path2/file?num=9.3 Response: ceil: 10 floor: 9. |