-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmath-function-method.js
More file actions
42 lines (30 loc) · 1.48 KB
/
math-function-method.js
File metadata and controls
42 lines (30 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//Using for math related query use this functions
//1. ceil(): Used for dacimal value convert to num and this convert to upper value
// var a = 45.3;
// console.log(Math.ceil(a));
//2. floor(): Used for dacimal value conver to num and this converted to lower num value or same num remove dacimal part ir check minus value then return greter value
// var a = 45.10;
// var a = -45.10;
// console.log(Math.floor(a)); // down word value provider
//3. round(): used for return nearest value for dacimal value
//console.log(Math.round(3.3));
//4. trunc(): used for retun int value remove after doted value
//console.log(Math.trunc(3.3));
//5. max(): used for return highest int value
//console.log(Math.max(10, 20, 30,50,40));
//6. min(): used for return lowest int value
//console.log(Math.min(10, 20, 30,50,40, 5, -2));
//7. sqrt(): used for return a squar root value
//console.log(Math.sqrt(4)); // value * value means 2*2, 4*4
//8. cbrt(): used for return a cubeq root value
//console.log(Math.cbrt(125)); // value devidation same value means 5*5*5 check only triple time
//9. pow(): used for return power value
// console.log(Math.pow(2, 2)); //means 2*2
// console.log(Math.pow(2, 3)); //means 2*2*2
// console.log(Math.pow(3, 4)); //means 3*3*3*3
//10. random(): used for return a rendom 0 to 1 value
//console.log(Math.random() * 10 + 10);
//11. abs(): used for return a absolute value and used only int value
//console.log(Math.abs(1*5));
//12. PI(): used for defult pi value
console.log(Math.PI)