--- title: "Math Component" slug: "math-component" updated: 2023-02-13T09:55:30Z published: 2023-02-13T09:55:31Z canonical: "help.pillir.io/math-component" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.pillir.io/llms.txt > Use this file to discover all available pages before exploring further. # Math Component The Math component consists of math operators with their specific functions. They are as follows: ## Number Input This block represents a number when it is given an input. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Number | Number | ![numberblock](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/numberblock.png) | ```javascript 0 ``` | ## Arithmetic Operators This block is used to perform the Arithmetic operations: Addition (+), Subtraction (-), Multiplication (x), Division, Power (^), and Remainder. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Variable or Number for all of the operations Choose the type of arithmetic operation from the dropdown list | Number | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620901924331.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620901942765.png) ![remainderblock](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/remainderblock.png) | ```javascript 1 + 1 1 - 1 1 * 1 1 / 1 Math.pow(1, 1) 64 % 10 ``` | ## Advance Operators The Advance operator blocks perform the following operations: | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Variable or Number for all of the operations Choose the type of Advance operator from the dropdown list | Returns number for all of these operations | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620901964263.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620901982151.png) | ```javascript Math.sqrt(9) Math.abs(9) -9 Math.log(9) Math.log(9) / Math.log(10) Math.exp(9) Math.pow(10,9) ``` | | Variable or Number Choose the type of Advance operator from the dropdown list | Returns number for all of these operations | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620902002730.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620902016765.png) | ```javascript Math.round(3.1) Math.ceil(3.1) Math.floor(3.1) ``` | | Variable or Number Choose the type of Advance operator from the dropdown list | Returns boolean (true or false) | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620902045147.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620902062821.png) | ```javascript 0 % 2 == 0 0 % 2 == 1 mathIsPrime(0) 0 % 1 == 0 0 > 0 0 < 0 0 % 0 == 0 ``` | | Variable or Number Choose the type of Advance operator from the dropdown list | Returns number for all of these operations | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620902092956.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620902109005.png) | ```javascript [].reduce(function(x, y) {return x + y;}); Math.min.apply(null, []); Math.max.apply(null, []); mathMean([]); mathMedian([]); mathModes([]); mathStandardDeviation([]); mathRandomList([]); ``` | | Variable or Number | Returns number | ![constraint](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/constraint.png) | ```javascript Math.min(Math.max(50, 1), 100); ``` | | Variable or Number | Returns Number | ![Random Integer](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/Random%20Integer.png) | ```javascript mathRandomInt(1, 100) ``` | | Variable or Number | Returns Number | ![Random fraction](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/Random%20fraction.png) | ```javascript Math.random() ``` | ## Constant Values In this block, Constant values are provided as inputs to perform operations pertaining to equations. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Choose any constant from the dropdown list | Returns the number value equal to the constant. | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620902180984.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620902211641.png) | ```javascript Math.PI Math.E (1 + Math.sqrt(5)) / 2 Math.SQRT2 Math.SQRT1_2 Infinity ``` | ## Degree Operators The Degree operators are used to perform trigonometric operations. They are: sin, cos, tan, arcsin, arccos, and arctan. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Choose the type of operation Degree value as variable or number | Returns the degree operation result value as a number | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620902245916.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620902268468.png) | ```javascript Math.sin(45 / 180 * Math.PI) Math.cos(45 / 180 * Math.PI) Math.tan(45 / 180 * Math.PI) Math.asin(45) / Math.PI * 180 Math.acos(45) / Math.PI * 180 Math.atan(45) / Math.PI * 180 ``` |