--- title: "Math Block" slug: "math" updated: 2021-08-06T03:13:39Z published: 2021-08-06T03:13:39Z canonical: "help.pillir.io/math" --- > ## 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 Block ### The Math operators with their respective blocks are as follows: ## Number Input:    This block represents a number when it is given as input.  | **Input** | **Output** | **Block Layout** | **Generated Code** | | --- | --- | --- | --- | | Number | Number | ![](https://lh3.googleusercontent.com/xIebg79vnXBj4Q2pfw2AxizzSsuj2ExvqLJ2A61Ky5AioWpCHZPodcKG7xKukefgUF_g12eTYeKA5MxUIIroCUCL9gSJRbsJDyXlOBAIFLxoDwDW0jGHsT0rMhSOy2UvIBvx4177) | ```javascript 0 ``` | ## Arithmetic Operator: It is used to perform the arithmetic operations: Addition (+), Subtraction (-), Multiplication (x), Division, Power (^), Reminder. | **Input** | **Output** | **Block Layout** | **Generated Code** | | --- | --- | --- | --- | | Variable or number for all Choose the type of arithmetic operation | 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)![](https://lh5.googleusercontent.com/qjvXpNqcYrzL1V01zxvboOJeJSWnBIowVxO-0Qss0KybPB6odUfCNFV2DjwfDe0-FKUKeBp0D46jdREYkuBk2EnB5LKVsc0_YlnHWd2hl1M5B69sKyWTu9giJGlfELoYeuafZc1J) | ```javascript 1 + 1 1 - 1 1 * 1 1 / 1 Math.pow(1, 1) 64 % 10 ``` | ## Advance Operator: Advance Operator performs the following Operations: Square Root,Absolute, Negative, Round Of up or down, Random Number Generator, Even/Odd, Random Fraction Number. | **Input** | **Output** | **Block Layout** | **Generated Code** | | --- | --- | --- | --- | | Variable or number for all Choose the type of advance operations. | Returns The number for all except number check block Returns The boolean (true or false) for number check block | ![](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) ![](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) ![](https://lh3.googleusercontent.com/ODeh_BfOxOeqvCsf9_0JCSfjzImYBOZqV-8-zdbu5zl0w-5xgubZkphCeDplmaGazARVbYS2PuMoOZdyZ34YrN-go1dYgjFRXRvkj2zV3VFaSHnKOZ95aTEd_vVoISlYWWmtzbIN) ![](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) ![](https://lh4.googleusercontent.com/-4_slaBLw-jj3QzUdpdQpVndYgWoF5zDZxvE_ZU4zGTVILz-jYW7SP95VWAb68Ac1rOx5tbBcsM6wrMxbuzK0lQLuf9S94ziD_Mkfxl9Irwac8p-0ZHZ9N-UBE38nk9Be2DoJa2g) ![](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) ![](https://lh3.googleusercontent.com/z0XIucSz9RPZP6HNrMklUwCSg3vi18a8iOqEGKs1Qo7rBZViXaBuQtqS6uUhLMALRypzeuu0H6RyNPCqIZ2wobFOwqwWIL4idDpaNL7aFwlYSHrhZ6Az7BUaUTMMh2ND3qQiPr2r) | ```javascript Math.sqrt(9) Math.abs(9) -9 Math.log(9) Math.log(9) / Math.log(10) Math.exp(9) Math.pow(10,9) Math.round(3.1) Math.ceil(3.1) Math.floor(3.1) Math.min(Math.max(50, 1), 100) 0 % 2 == 0 0 % 2 == 1 mathIsPrime(0) 0 % 1 == 0 0 > 0 0 < 0 0 % 0 == 0 Math.random() [].reduce(function(x, y) {return x + y;}); Math.min.apply(null, []); Math.max.apply(null, []); mathMean([]); mathMedian([]); mathModes([]); mathStandardDeviation([]); mathRandomList([]); Math.min(Math.max(50, 1), 100); ``` | ## Constant Values: In this block, constant values are provided as inputs to perform operations pertaining to equations. | **Input** | **Output** | **Block Layout** | **Generated Code** | | --- | --- | --- | --- | | Any constant | 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 Operation: The Degree Operations are used to perform trigonometric operations. They are: sin, cos, tan, arcsin, arccos, 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 ``` |