Math object's properties and methods
2005-04-07 10:29
435 查看
The Math object's properties and methods are described below:
NN: Netscape, IE: Internet Explorer
NN: Netscape, IE: Internet Explorer
Properties
Syntax: object.property_nameProperty | Description | NN | IE |
---|---|---|---|
E | Returns the base of a natural logarithm | 2 | 3 |
LN2 | Returns the natural logarithm of 2 | 2 | 3 |
LN10 | Returns the natural logarithm of 10 | 2 | 3 |
LOG2E | Returns the base-2 logarithm of E | 2 | 3 |
LOG10E | Returns the base-10 logarithm of E | 2 | 3 |
PI | Returns PI | 2 | 3 |
SQRT1_2 | Returns 1 divided by the square root of 2 | 2 | 3 |
SQRT2 | Returns the square root of 2 | 2 | 3 |
Methods
Syntax: object.method_name()Method | Description | NN | IE |
---|---|---|---|
abs(x) | Returns the absolute value of x | 2 | 3 |
acos(x) | Returns the arccosine of x | 2 | 3 |
asin(x) | Returns the arcsine of x | 2 | 3 |
atan(x) | Returns the arctangent of x | 2 | 3 |
atan2(y,x) | Returns the angle from the x axis to a point | 2 | 3 |
ceil(x) | Returns the nearest integer greater than or equal to x | 2 | 3 |
cos(x) | Returns the cosine of x | 2 | 3 |
exp(x) | Returns the value of E raised to the power of x | 2 | 3 |
floor(x) | Returns the nearest integer less than or equal to x | 2 | 3 |
log(x) | Returns the natural log of x | 2 | 3 |
max(x,y) | Returns the number with the highest value of x and y | 2 | 3 |
min(x,y) | Returns the number with the lowest value of x and y | 2 | 3 |
pow(x,y) | Returns the value of the number x raised to the power of y | 2 | 3 |
random() | Returns a random number between 0 and 1 | 2 | 3 |
round(x) | Rounds x to the nearest integer | 2 | 3 |
sin(x) | Returns the sine of x | 2 | 3 |
sqrt(x) | Returns the square root of x | 2 | 3 |
tan(x) | Returns the tangent of x | 2 | 3 |
相关文章推荐
- Javascript Object Method Properties console.log View all methods and properties of the object
- The Boolean object's properties and methods
- Date object's properties and methods
- String object's properties and methods
- Layout Properties And Methods In Element, HTMLElement And Window
- How to avoid traps and correctly override methods from java.lang.Object
- JavaScript Patterns 5.3 Private Properties and Methods
- NSNotification, UserInfo and Object Methods
- Professional JS(5.5.5-function properties and methods&&5.6primitive wrapper type)
- [JavaScript] Function Properties and Methods
- HTML DOM Properties and Methods
- Xrm.Page.data.entity Properties and Methods
- .Net 3.5新特性(1)Automatic Properties, Object Initializers, and Collection Initializers
- New C# "Orcas" Language Features: Automatic Properties, Object Initializers, and Collection Initializers
- Javascript Module pattern template. Shows a class with a constructor and public/private methods/properties. Also shows compatibility with CommonJS(eg Node.JS) and AMD (eg requireJS) as well as in a br
- 2.4 The Object Model -- Computed Properties and Aggregate Data with @each(计算的属性和使用@each聚合数据)
- Microsoft.XMLDOM(XMLDOM)对象的属性和方法(Methods and properties of Microsoft.XMLDOM)
- Difference between event.target and event.currentTarget properties in an event object.
- Let Us Fuck Up Getter And Setter (1)- Java Object Properties Copy
- How to avoid traps and correctly override methods from java.lang.Object