- var quotient = Math.floor(y/x); var remainder = y % x; …
- var num = ~~(a / b); …
- var num = (a / b) >> 0; …
- var div = Math.trunc(y/x); var rem = y % x;
- Math.round() Math.round(x) returns the value of x rounded to its nearest integer: …
- Math.pow() Math.pow(x, y) returns the value of x to the power of y: …
- Math.sqrt() Math.sqrt(x) returns the square root of x: …
- Math.abs() Math.abs(x) returns the absolute (positive) value of x: …
- Math.ceil() …
- Math.floor() …
- Math. …
addition assignment operator
An operator performs some operation on single or multiple operands (data value) and produces a result. … For example 1 + 2, where + sign is an operator and 1 is left operand and 2 is right operand. + operator adds two numeric values and produces a result which is 3 in this case.
The parseInt() function parses a string and returns an integer. The radix parameter is used to specify which numeral system to be used, for example, a radix of 16 (hexadecimal) indicates that the number in the string should be parsed from a hexadecimal number to a decimal number.
Can I do math in HTML?
The <MATH> element is used to include math expressions in the current line. When rendering to fixed pitch text-only media, simple text graphics can be used for math symbols such as the integration sign, while other symbols can be rendered using their entity names. …
spread / rest operator