Here you can find a number of examples on Java Script.Please find the various kinds of examples listed on the right side of this site. If you don't find anything on Java Script then please write to us or leave a commnet. We are pleased to help and find the solution of your problem.

JavaScript: PI Function



PI:
The ratio of the circumference of a circle to its diameter, approximately 3.14159.

Description:
Because PI is a static property of Math, you always use it as Math.PI, rather than as a property of a Math object you created.



Example

<html>
<head>
<title>Calculate PI Value</title>

<script language="javascript">
document.write(Math.PI);
</script>

</head>
</html>


OUTPUT

3.141592653589793

No comments:

Post a Comment

Google