Math constants return constant values that are properties of the Math object.
Syntax ExamplesThe following example illustrates how to use the Math.PI constant.
var radius = 3;
var area = Math.PI * radius * radius;
document.write(area);
Math Object Constants
The following table lists constant values that are properties of the Math object.
Constant Description Approximate value Math.E The mathematical constant e. This is Euler’s number, the base of natural logarithms. 2.718 Math.LN2 The natural logarithm of 2. 0.693 Math.LN10 The natural logarithm of 10. 2.302 Math.LOG2E The base-2 logarithm of e. 1.443 Math.LOG10E The base-10 logarithm of e. 0.434 Math.PI Pi. This is the ratio of the circumference of a circle to its diameter. 3.14159 Math.SQRT1_2 The square root of 0.5, or, equivalently, one divided by the square root of 2. 0.707 Math.SQRT2 The square root of 2. 1.414 See also Other articles AttributionsMicrosoft Developer Network: Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4