/
number.html
65 lines (43 loc) · 1.1 KB
/
number.html
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
<script>
/*let billion=1e9;
alert(billion);
alert(7.39e);*/
//alert(oxff);
/*let num=255;
alert(num.toString(14));
alert(num.toString(2));
alert(123456..toString(36));*/
/*let num=144;
alert(num.toString(16));
alert(num.toString(4));
alert(1234567).toString(44);*/
/*let num=1.234567
alert(Math.floor(num*100)/100);
alert(num.toFixed(4));
alert(num.toFixed(7));*/
/*alert(0.1+0.4);
alert(0.1.toFixed(24));*/
/*alert(isFinite("str"));
alert(isFinite(Infinity));
alert(parseInt('100px'));
alert(parseFloat('12.5'));
alert(parseFloat('12.4.4'));
alert(parseInt('a1234'));*/
/*alert(parseInt('oxff',16));
alert(parseInt('ff',16));
alert(parseInt('2n9c',55));*/
/*alert(Math.random());
alert(Math.Random());
alert(Math.Random());*/
/*alert(Math.max(3,4,-14,0,-1));
alert(Math.min(1,2,3,4));
alert(Math.pow(2,14));*/
/*alert(1.44.toFixed(24));
alert(Math.round(6.44*4)/4);
alert(Math.random(1,4));
alert(Math.random(1,7));*/
/*alert(randomInteger(1,4));
alert(randomInteger(1,4));
alert(randomInteger(1,4));*/
alert(Math.random(1,4));
</script>