1abs(x) Returns the absolute value of x
2acos(x) Returns the arccosine of x, in radians
3acosh(x) Returns the hyperbolic arccosine of x
4asin(x) Returns the arcsine of x, in radians
5asinh(x) Returns the hyperbolic arcsine of x
6atan(x) Returns the arctangent of x as a numeric value between -PI/2 and PI/2 radians
7atan2(y, x) Returns the arctangent of the quotient of its arguments
8atanh(x) Returns the hyperbolic arctangent of x
9cbrt(x) Returns the cubic root of x
10ceil(x) Returns x, rounded upwards to the nearest integer
11cos(x) Returns the cosine of x (x is in radians)
12cosh(x) Returns the hyperbolic cosine of x
13exp(x) Returns the value of Ex
14floor(x) Returns x, rounded downwards to the nearest integer
15log(x) Returns the natural logarithm (base E) of x
16max(x, y, z, ..., n) Returns the number with the highest value
17min(x, y, z, ..., n) Returns the number with the lowest value
18pow(x, y) Returns the value of x to the power of y
19random() Returns a random number between 0 and 1
20round(x) Rounds x to the nearest integer
21sin(x) Returns the sine of x (x is in radians)
22sinh(x) Returns the hyperbolic sine of x
23sqrt(x) Returns the square root of x
24tan(x) Returns the tangent of an angle
25tanh(x) Returns the hyperbolic tangent of a number
26trunc(x) Returns the integer part of a number (x)
1E: 2.718281828459045
2LN2: 0.6931471805599453
3LN10: 2.302585092994046
4LOG2E: 1.4426950408889634
5LOG10E: 0.4342944819032518
6PI: 3.141592653589793
7SQRT1_2: 0.7071067811865476
8SQRT2: 1.4142135623730951
9abs: ƒ abs()
10acos: ƒ acos()
11acosh: ƒ acosh()
12asin: ƒ asin()
13asinh: ƒ asinh()
14atan: ƒ atan()
15atan2: ƒ atan2()
16atanh: ƒ atanh()
17cbrt: ƒ cbrt()
18ceil: ƒ ceil()
19clz32: ƒ clz32()
20cos: ƒ cos()
21cosh: ƒ cosh()
22exp: ƒ exp()
23expm1: ƒ expm1()
24floor: ƒ floor()
25fround: ƒ fround()
26hypot: ƒ hypot()
27imul: ƒ imul()
28log: ƒ log()
29log1p: ƒ log1p()
30log2: ƒ log2()
31log10: ƒ log10()
32max: ƒ max()
33min: ƒ min()
34pow: ƒ pow()
35random: ƒ random()
36round: ƒ round()
37sign: ƒ sign()
38sin: ƒ sin()
39sinh: ƒ sinh()
40sqrt: ƒ sqrt()
41tan: ƒ tan()
42tanh: ƒ tanh()
43trunc: ƒ trunc()
44Symbol(Symbol.toStringTag): "Math"
45__proto__: Object
1//Math in JS is similar and different to the one in real life
2//Like: "+", "-" signs are the same. But "X" and "÷" are replaced with "*" and "/" respectivly
3//You can do math both with variables and normal numbers
4________________________________________________________________________________
5 Normal Number Examples
6
74+4 = 8;
84-4 = 0;
94*4 = 16;
104/4 = 1;
11________________________________________________________________________________
12 Variable Examples
13
14num1 = 0;
15num2 = 0;
16ans = 0;
17
18num1 = 4;
19num2 = 64
20
21num1 + num2 = 68
22num1 - num2 = 60
23num1 * num2 = 24
24num1 / num2 = 256;
25
26num1 + num2 = ans;
27num1 - num2 = ans;
28num1 * num2 = ans;
29num1 / num2 = ans;
30________________________________________________________________________________
31Now, you can use the document.getElementByID("").innerHTML = ans; to set the answer
32
33
34
35//I hope this post helped you!
1
2Math.ceil(4.9); // returns 5
3
4Math.ceil(4.7); // returns 5
5
6Math.ceil(4.4); // returns 5
7
8Math.ceil(4.2); // returns 5
9
10Math.ceil(-4.2); // returns -4
11
12
1
2Math.floor(4.9); // returns 4
3
4Math.floor(4.7); // returns 4
5
6Math.floor(4.4); // returns 4
7
8Math.floor(4.2); // returns 4
9
10Math.floor(-4.2); // returns -5
11
12
1The top-level element in MathML is <math>. Every valid MathML instance must be wrapped in <math> tags. In addition you must not nest a second <math> element in another, but you can have an arbitrary number of other child elements in it.
2
3Examples
4
5Theorem of Pythagoras
6
7HTML5 notation
8<!DOCTYPE html>
9<html>
10 <head>
11 <title>MathML in HTML5</title>
12 </head>
13 <body>
14
15 <math>
16 <mrow>
17 <mrow>
18 <msup>
19 <mi>a</mi>
20 <mn>2</mn>
21 </msup>
22 <mo>+</mo>
23 <msup>
24 <mi>b</mi>
25 <mn>2</mn>
26 </msup>
27 </mrow>
28 <mo>=</mo>
29 <msup>
30 <mi>c</mi>
31 <mn>2</mn>
32 </msup>
33 </mrow>
34 </math>
35
36 </body>
37</html>