Number Formula
Introduction
Sapper supports a variety of number formulas. Those are mentioned in this section.
Formulas
SUM
Description | Returns the sum of number 1 and number 2 |
Syntax | Expression: SUM (number1, [number2]) Return Type: Integer |
Example | Expression: SUM(4,3) Result: 7 |
SUBSTRACT
Description | Returns the Subtracted value of number B from number A |
Syntax | Expression: SUBSTRACT(number A,number2) Return Type: Integer |
Example | Expression: SUBSTRACT(4,3) Result: 1 |
PRODUCT
Description | Multiplies number A with number B |
Syntax | Expression: PRODUCT (number A, [number B], ...) Return Type: Integer |
Example | Expression: PRODUCT(4,3) Result: 12 |
DIVIDE
Description | Divides number A by number B |
Syntax | Expression: DIVIDE(numberA, numberB) Return Type: Integer |
Example | Expression: DIVIDE(4,2) Result: 2 |
QUOTIENT
Description | Returns the quotient of given integers |
Syntax | Expression: QUOTIENT (numerator, denominator) Return Type: Float |
Example | Expression: QUOTIENT(4,3) Result: 1.3333333333333333 |
POWER
Description | Returns the given number raise to the provided power |
Syntax | Expression: POWER (number, power) Return Type: Float |
Example | Expression: POWER(4,3) Result: 64.0 |
SQRT
Description | Return the square root of the given integer |
Syntax | Expression: SQRT (number) Return Type: Integer |
Example | Expression: SQRT(4) Result: 2 |
MOD
Description | Divide the number A by B and give remainder as Answer |
Syntax | Expression: MOD (number A, number B(divisor)) Return Type: Integer |
Example | Expression: MOD(4,3) Result: 1 |
MAX
Description | Return the greater integer from A and B |
Syntax | Expression: MAX (numberA, [numberB], ...) Return Type: Integer |
Example | Expression: MAX(4,3) Result: 4 |
MIN
Description | Return the smallest integer from A and B |
Syntax | Expression: MIN (number A, [number B], ...) Return Type: Integer |
Example | Expression: MIN(4,3) Result: 3 |
ABS
Description | Returns the absolute(positive) value of the given integer |
Syntax | Expression: ABS (number) Return Type: Integer |
Example | Expression: ABS(-4) Result: 4 |
ROUND
Description | Round the given number |
Syntax | Expression: ROUND (number, num_digits) Return Type: Integer |
Example | Expression: ROUND(4,79) Result: 5 |
ISEVEN
Description | Check the given integer is even or not |
Syntax | Expression: ISEVEN (number) Return Type: Boolean |
Example | Expression: ISEVEN (7) Result: false |
ISODD
Description | Checks the integer is odd or not |
Syntax | Expression: ISODD (number) Return Type: Boolean |
Example | Expression: ISODD(‘7’) Result: true |
TO_F
Description | Converts data to a float (number) datatype |
Syntax | Expression: TO_F(Object o) Return Type: Float |
Example | Expression: TO_F(12.34) Result: 12.34 |
TO_I
Description | Converts data to an integer (whole number) datatype |
Syntax | Expression: TO_I(Object o) Return Type: Integer |
Example | Expression: TO_I(1.234) Result: 1 |
FLOOR
Description | Rounds the given integer to the next smaller integer or float |
Syntax | Expression: FLOOR (number, significance) Return Type: Integer |
Example | Expression: FLOOR(4,3) Result: 4 |
CEILING
Description | Returns the smallest (closest to negative infinity) value which is greater than or equal to the argument and, is equal to a mathematical integer |
Syntax | Expression: CEILING (number, significance) Return Type: Integer |
Example | Expression: CEILING(4,3) Result: 3 |