-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMath.js
17 lines (17 loc) · 832 Bytes
/
Math.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
console.log(Math.PI);
let num = 10.555;
console.log(Math.round(num));
console.log(Math.pow(2, 7));
console.log(Math.pow(5, 9));
console.log(Math.sqrt(81));
console.log(Math.sqrt(66));
console.log(Math.abs(-55));//Returns the absolute value of a number
console.log(Math.abs(55));
console.log(Math.round(7.2));
console.log(Math.ceil(7.6));//Returns the smallest integer greater than or equal to its numeric argument.
console.log(Math.floor(7.2));//Returns the greatest integer less than or equal to its numeric argument.
console.log(Math.min(0, -90, -8990, 536));//Returns the smaller of a set of supplied numeric expressions
console.log(Math.max(0, 90, -8990, 536));//Returns the larger of a set of supplied numeric expressions.
console.log(Math.floor(Math.random()*10));
console.log(Math.trunc(4.6));
console.log(Math.trunc(-4.6));