-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02_number.js
More file actions
70 lines (64 loc) · 2.17 KB
/
02_number.js
File metadata and controls
70 lines (64 loc) · 2.17 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
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
//number
// const num = 42//integer
// const float = 42.42// float
// const pow =10e3// степень (10 в 3)
// console.log(pow)
// console.log(Number.MAX_SAFE_INTEGER)
// console.log('MAX_VALUE', Number.MAX_VALUE);
// console.log('MIN_VALUE', Number.MIN_VALUE);
// console.log('Math.pow' , Math.pow(2 , 53));
// console.log('Positive_Infinity' , Number.POSITIVE_INFINITY);
// console.log('Negative_Infinity' , Number.NEGATIVE_INFINITY);
// console.log('1/0' , 1/0);
// console.log(Number.NaN);// Not a number
// console.log(typeof NaN);
// const weird = 2/ undefined
// console.log(Number.isNaN(weird))
// console.log(Number.isNaN(42))
// console.log(Number.isFinite(Infinity))
// console.log(Number.isFinite(42))
//
//
// const stringInt = '40'
// const stringFloat = '40.42'
// console.log(Number.parseInt(stringInt)+2);
// console.log(Number(stringInt)+2);
// console.log(+stringInt +2);
//
// console.log(parseFloat(stringFloat)+2);
//Все остальное аналогично
// console.log(0.4+0.2)
// console.log((4/10)+(2/10));
// console.log(+(0.4+0.2).toFixed(1))
// console.log(parseFloat((0.4+0.2).toFixed(1)));
//BigInt
// console.log(Number.MAX_SAFE_INTEGER)
// console.log(typeof 900719925474099199999999)
// console.log(900719925474099199999999n)
// console.log(-900719925474099199999999n)
// console.log(typeof 900719925474099199999999n)
// console.log(900719925474099199999999.2333n)//console.error();
// console.log(10n-4)//console.error()
// console.log(parseInt(10n)-4);
// console.log(10n-BigInt(4));
// console.log(5n/2n);
// // //3 Math
// // console.log(Math.E);
// // console.log(Math.PI);
// //
// // console.log(Math.sqrt(25));
// // console.log(Math.pow(5, 3));
// // console.log(Math.abs(-42));
// // console.log(Math.max(42,54,95,422));
// // console.log(Math.min(42,54,95,422));
// // console.log(Math.floor(4.9));
// // console.log(Math.ceil(4.9));
// // console.log(Math.round(4.9));
// // console.log(Math.trunc(4.9));
// //Если есть вопросы, то MDN и любой оператор
// console.log(Math.random());
// //4
// function getRandomBetween(min, max){
// return Math.floor(Math.random()*(max-min+1)+min)
// }
// console.log(getRandomBetween(10, 42))