The following table summarizes the support for mathematical computation in JavaScript:
Function | Object | Type | Description |
---|---|---|---|
abs() | Math | Function | Absolute value of a number |
acos() | Math | Function | Inverse cosine |
asin() | Math | Function | Inverse sine |
atan() | Math | Function | Inverse tangent |
atan2() | Math | Function | Inverse tangent of a slope |
ceil() | Math | Function | Round up |
cos() | Math | Function | Cosine of an angle |
E | Math | Constant | Exponential constant |
exp() | Math | Function | Exponent function |
floor() | Math | Function | Round down |
isFinite() | Global | Function | Test for infinity |
isNaN() | Global | Function | Test for Not-a-Number |
LN10 | Math | Constant | Natural log of 10 |
LN2 | Math | Constant | Natural log of 2 |
log() | Math | Function | Natural log of a number |
LOG10E | Math | Constant | Log to the base 10 of e |
LOG2E | Math | Constant | Log to the base 2 of e |
max() | Math | Function | Maximum of two values |
MAX_VALUE | Number | Constant | Maximum numeric value |
min() | Math | Function | Minimum of two values |
MIN_VALUE | Number | Constant | Minimum numeric value |
NaN | Number | Constant | Not a number |
NEGATIVE_INFINITY | Number | Constant | Negative infinity |
parseFloat() | Global | Function | Floating point parser |
parseInt() | Global | Function | Integer parser |
PI | Math | Constant | The value of PI |
POSITIVE_INFINITY | Number | Constant | Positive infinity |
pow() | Math | Function | A value rased to the power of another |
random() | Math | Function | A random value |
round() | Math | Function | Truncating round |
sin() | Math | Function | Sine of an angle |
sqrt() | Math | Function | Square root |
SQRT1_2 | Math | Constant | Square toot of one half |
SQRT2 | Math | Constant | Square root of two |
tan() | Math | Function | Tangent of an angle |
You should avoid the use of any of these function names as identifiers unless you are intentionally overriding their behavior by adding function properties (methods) to a prototype.
Prev | Home | Next |
Math.tan() | Up | Matrix() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |