-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs13.html
45 lines (41 loc) · 1.62 KB
/
js13.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="X-UA-Compatible"content="ie-edge">
<title>math object</title>
</head>
<body>
<div class="container">
this is math object tutorial
</div>
<script>
//printing object
console.log("math object tutorial")
let m=Math;
console.log(m);
console.log("the values of E is"+Math.E )
console.log("the value of ln2 is "+Math.LN2)
console.log("The value of ln10 is "+Math.LN10)
//Functions in Math object
let a = 34.6465;
let b= 89;
console.log("the value of a and b is",a,"and",b);
console.log("a rounded as ",Math.round(a));
//ceil and floor function
console.log("the value of 5 rounded up is ",Math.ceil(5.8));
console.log("the value of 5 rounded down is ",Math.floor(5.8));
//minimum and maximum values
console.log("the maximum value of the two is ",Math.max(4.5,9));
console.log("the minimum value of the two is ",Math.min(4.5,9));
//creating a random number
let r = Math.random();
console.log("random value obtained is ",r);
let h = 1;
let i = 23;
g= a+ (b-a)*Math.random();
console.log("the value is ",g)
</script>
</body>
</html>