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