JS Math Methods

 
<!DOCTYPE html>
<html>
<head>
  <title>JavaScript</title>
  <script>
    /* Ceil Method Example */
	var a = Math.ceil(1.2);
	document.write(a + "<br>");

	/* Floor Method */
	var b = Math.floor(5.10);
	document.write(b + "<br>");

	/* Round Method */
	var c = Math.round(2.60);
	document.write(c + "<br>");

	/* Trunc Method */
	var d = Math.trunc(8.19);
	document.write(d + "<br>");

	/* Max Method */
	var i = Math.max(8, 10 ,2 ,50 ,25);
	document.write(i + "<br>");

	/* Min Method */
	var j = Math.min(8, 10, 2, 50, 25);
	document.write(j + "<br>");

	/* Sqrt Method */
	var k = Math.sqrt(64);
	document.write(k + "<br>");

	/* Cbrt Method */
	var l = Math.cbrt(125);
	document.write(l + "<br>");

	/*Pow Method */
	var p = Math.pow(2,3);
	document.write(p + "<br>");

	/*Random Method */
	var x = Math.floor(Math.random() * 10) + 1;
	document.write(x + "<br>");

	/*Abs Method */
	var y = Math.abs(5.25);
	document.write(y + "<br>");

	/*Pi Method */
	var z = Math.PI;
	document.write(z + "<br>");
  </script>
</head>
<body>
</body>
</html>