This topic describes the syntax, feature, parameters, and return values of numeric functions. This topic also provides examples of numeric functions.
add | sub | mul | div | mod | gt | ge | lt | le | floor | ceil
add
Item | Description |
Syntax | |
Feature | Calculates the sum of two addends. |
Parameters |
|
Return value | The sum of |
Example |
Output:
|
sub
Item | Description |
Syntax | |
Feature | Calculates the difference between two numbers. |
Parameters |
|
Return value | The difference of n1-n2. |
Example |
Output:
|
mul
Item | Description |
Syntax | |
Feature | Calculates the product of two numbers. |
Parameters |
|
Return value | The product of n1×n2. |
Example |
Output:
|
div
Item | Description |
Syntax | |
Feature | Calculates the quotient of two numbers. |
Parameters |
|
Return value | The quotient of n1/n2. |
Example |
Output:
|
mod
Item | Description |
Syntax |
|
Feature | Calculates the remainder after division of one number by another. |
Parameters |
|
Return value | The remainder of n1%n2. |
Example |
Output:
|
gt
Item | Description |
Syntax |
|
Feature | Determines whether a number is greater than another number. |
Parameters |
|
Return values | If n1 > n2, |
Example |
Request: Response:
|
ge
Item | Description |
Syntax |
|
Feature | Determines whether a number is greater than or equal to another number. |
Parameters |
|
Return values | If n1 >= n2, |
Example |
Request: Response:
|
lt
Item | Description |
Syntax | |
Feature | Determines whether a number is smaller than another number. |
Parameters |
|
Return values | If n1 < n2, |
Example |
Request: Response:
|
le
Item | Description |
Syntax |
|
Feature | Determines whether a number is smaller than or equal to another number. |
Parameters |
|
Return values | If n1 <= n2, |
Example |
Request: Response:
|
floor
Item | Description |
Syntax | |
Feature | Rounds down to the greatest integer that is smaller than or equal to a number. |
Parameter | n: the number to be rounded down. |
Return value | The greatest integer that is smaller than or equal to the number specified by |
Example |
Request: Response:
|
ceil
Item | Description |
Syntax | |
Feature | Rounds up to the smallest integer that is greater than or equal to a number. |
Parameter | n: the number to be rounded up. |
Return value | The smallest integer that is greater than or equal to the number specified by n. |
Example |
Request: Response:
|