-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path08_numbers&maths.js
109 lines (70 loc) · 2.54 KB
/
08_numbers&maths.js
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// const ganeshMarks = 16
// console.log(typeof ganeshMarks)
const ganeshMarks = new Number(16)
// console.log(typeof ganeshMarks)
//ganesh is a rich person
// let ganeshBankBalance = new Number(100000000)
// console.log(`ganesh bank balance: ${ganeshBankBalance.toLocaleString()}`)
// let durveshScore = 33 //number
// let durveshScoreToString = durveshScore.toString()
// console.log(typeof durveshScoreToString)
// let sureshTemp = 36.234
// console.log(sureshTemp.toFixed(2)) //precision value
// const karanIqLevel = 88.8999
// console.log(karanIqLevel.toPrecision(1))
//min max values ko bhi dekhendge
////////////maths
// console.log(Math)
// console.log(Math.abs(5)) //5
// console.log(Math.round(44.42222))
// console.log(Math.floor(44.987))
// console.log(Math.max(2, 4, 5, 3, 23, 4, 45, 3, 2, 33, 21))
// const number = 35
// console.log(typeof number)
// const number1 = new Number(33) //console.log(type)
// console.log(typeof number1)
// console.log(Number)
//Number methods
// const prasadBandBalance = new Number(10000000000)
// console.log(`Bank balance of prasad is ${prasadBandBalance.toLocaleString()}`)
//toString()
// const vaibhav = 18
// console.log(typeof vaibhav)
// const vaibhavMarks = vaibhav.toString()
// console.log(typeof vaibhavMarks)
// //toFixed()
// const abhishekScore = 55.69
// console.log(abhishekScore.toFixed())
// const aishwaryaTemp = 34.367
// console.log(aishwaryaTemp.toPrecision(4)) //34.37
/////////////////////////////////////////////////////////////
//MATHS
// console.log(Math)
// 1]Math.abs
let randomNumber = Math.random();//0-1
// console.log(Math.floor((randomNumber*10)+1));
// function getRandomArbitrary(min, max) {
// return Math.floor(Math.random() * (max - min) + min);
// }
// console.log(getRandomArbitrary(10,20))
//Math()
// let negNumber = 5
// console.log(Math.abs(negNumber)) //5
// let pointNumber = 4.6 //4
// // console.log(Math.round(pointNumber))
// console.log(Math.floor(pointNumber))
// console.log(Math.max(4,5,2,3)) //2 5
/////////////////////////////////////////////////////////////
// let randomNumber1 = Math.floor(Math.random()*10+1); // 1-10
// console.log(randomNumber1)
//I want a number between 10 - 20
// let randomNumber1 = Math.floor(Math.random() * 10 + 10); 0-1
// console.log(randomNumber1)
// function minmax(min, max) {
// }
// function random(min, max) {
// const num = Math.floor(Math.random() * (max - min + 1)) + min;
// return num;
// }
// let generatedOutcome = random(50,100);
// console.log(generatedOutcome);