Skip to main content
Blocks under 'Math' Category

This article helps you understand blocks available under 'Math' category in AppBuilder Code Editor.

Updated over a month ago

Numeric

See an example to understand how to use 'Numeric' block.

Block for numeric value.

Parse Number Operator

Block for parse number operator. It parses a string and returns a number.

Rounding Block

Block for rounding the number to keep only the passed number of decimals. It is rounding the number to keep only the passed number of decimals.

Basic Arithmetic Operator

See an example to understand how to use 'Basic Arithmetic Operator' block.

Block for advanced math operators with single operand. Returns the value based on the operation selected on the two numbers entered separately. Supported math operators are '+' (addition), '-' (subtraction), '×' (multiplication), '÷' (division), '^' (exponents).

Advanced Math Operator with Single Operand

Block for advanced math operator with single operand. Use this block to perform a function on a single number and return the result. Supported advanced math operators are 'square root', 'absolute' (absolute value), '-' (inverse), 'In' (natural logarithm), 'log10' (base 10 logarithm), 'e^' (exponential), and '10^' (power of 10).

Trigonometric Functions

Block for trigonometric functions. Use this block to perform trigonometric function on a single number in degrees and return the result. Supported trigonometric functions are 'sin' (sine), 'cos' (cosine), 'tan' (tangent), 'asin' (arcsine), 'acos' (arccosine), and 'atan' (arctangent).

Common Constants

Block to return the value of a common constant. Supported common constants are 'π' (pi which is 3.141...), 'e' (the exponential constant which is 2.718...), φ (the golden ratio which is 1.618...), 'sqrt(2)' (the square root of 2 which is 1.414...), 'sqrt(1/2)' (the square root of ½ which is 0.707...), and '∞' (infinity).

Value Property

Block to check the type of number and return a value of 'true' or 'false' accordingly. The block can check if a number is even, odd, prime, whole, positive, negative, or divisible by a given number.

Change By

Block to increment the value of a selected variable by the amount attached to the input on the right. The result of this is a variable with a new value.

Rounding Function

Block to round numbers to the nearest integer and return the result. Available options include:

  • 'round': Round down for decimals less than 0.5, round up for decimals greater than or equal to 0.5.

  • 'round up': Always round up the number regardless of the decimal value.

  • 'round down': Always round down the number regardless of the decimal value.

Statistical Functions

Block to calculate statistics on two or more numbers and return the result. This block requires a list of numbers instead of a single number. Available options include:

  • 'sum': Add together all numbers in the list.

  • 'min': Return the smallest number in the list.

  • 'max': Return the largest number in the list.

  • 'average': Return the mean of the numbers in the list.

  • 'median': Return "the middle" value in the list.

  • 'mode': Return the values that appear most often in the list.

  • 'standard deviation': Return the standard deviation of the numbers in the list.

  • 'random item': Return a random number in the list.

Remainder

Block which returns the remainder from dividing two numbers.

Constrain Number

Block which returns a number that's constrained between two specified values (inclusive). If the number is higher than the specified high number, the block returns the high number. If the number is lower than the specified low number, the block returns the low number.

Random Number

Block which returns an random integer between the two specified numbers (inclusive).

Random Fraction

Block which returns a random decimal between 0.0 (inclusive) and 1.0 (exclusive).


Related Article: AppBuilder Code Editor


Did this answer your question?