-
Notifications
You must be signed in to change notification settings - Fork 0
/
tut61.html
42 lines (35 loc) · 1.24 KB
/
tut61.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Maths object</title>
</head>
<body>
<div class="container">
<h1>This is heading</h1>
</div>
<script>
m = Math;
console.log(m);
console.log("This is a value of math.e", Math.E);
console.log("This is a value of math.pi", Math.PI);
let a=5;
let b=33.5;
console.log("The value of a and b is", a, b);
console.log("The value of a and b is", Math.pow(3, 2));
console.log("The value of a and b is", Math.sqrt(49));
console.log("The value of a and b is", Math.ceil(4.5));
console.log("The value of a and b is", Math.floor(49.8));
console.log("The value of a and b is", Math.abs(-49.8));
console.log("The value of a and b rounded is ", Math.round(a), Math.round(b));
let r = Math.random();
console.log("The random number is ", r);
let a1 = 50;
let b1 = 60;
let r50_60 = a1 + (b1-a1)*Math.random();
console.log("The random number is ", r50_60)
</script>
</body>
</html>