w3pop.com :: ÍøÂçѧԺ :: JavaScript :: JSÊýѧ¶ÔÏó²Î¿¼
FF: Firefox, N: Netscape, IE: Internet Explorer
FF:»ðºü£¬N:Íø¾°£¬IE
| Method ·½·¨ |
Description ÃèÊö |
FF | N | IE |
|---|---|---|---|---|
| abs(x) | Returns the absolute value of a number ·µ»ØÊý×ֵľø¶ÔÖµ |
1 | 2 | 3 |
| acos(x) | Returns the arccosine of a number ·µ»ØÊý×ֵķ´ÓàÏÒÖµ |
1 | 2 | 3 |
| asin(x) | Returns the arcsine of a number ·µ»ØÊý×ֵķ´ÕýÏÒÖµ |
1 | 2 | 3 |
| atan(x) | Returns the arctangent of x as a numeric value between -PI/2 and PI/2 radians ·µ»ØÎ»ÓÚ-PI/2 ºÍ PI/2 µÄ·´ÕýÇÐÖµ |
1 | 2 | 3 |
| atan2(y,x) | Returns the angle theta of an (x,y) point as a numeric value between -PI and PI radians ·µ»Ø£¨x£¬y£©Î»ÓÚ -PI µ½ PI Ö®¼äµÄ½Ç¶È |
1 | 2 | 3 |
| ceil(x) | Returns the value of a number rounded upwards to the nearest integer ·µ»Ø x ËÄÉáÎåÈëºóµÄ×î´óÕûÊý |
1 | 2 | 3 |
| cos(x) | Returns the cosine of a number ·µ»ØÒ»¸öÊý×ÖµÄÓàÏÒÖµ |
1 | 2 | 3 |
| exp(x) | Returns the value of Ex ·µ»Ø E^x Öµ |
1 | 2 | 3 |
| floor(x) | Returns the value of a number rounded downwards to the nearest integer ·µ»Ø x ËÄÉáÎåÈëºóµÄ×îСÕûÊý |
1 | 2 | 3 |
| log(x) | Returns the natural logarithm (base E) of a number ·µ»Øµ×ÊýΪEµÄ×ÔÈ»¶ÔÊý |
1 | 2 | 3 |
| max(x,y) | Returns the number with the highest value of x and y ·µ»Ø x ºÍ y Ö®¼ä½Ï´óµÄÊý |
1 | 2 | 3 |
| min(x,y) | Returns the number with the lowest value of x and y ·µ»Ø x ºÍ y Ö®¼ä½ÏСµÄÊý |
1 | 2 | 3 |
| pow(x,y) | Returns the value of x to the power of y ·µ»Ø y^x µÄÖµ |
1 | 2 | 3 |
| random() | Returns a random number between 0 and 1 ·µ»ØÎ»ÓÚ 0 µ½ 1 Ö®¼äµÄËæ»úº¯Êý |
1 | 2 | 3 |
| round(x) | Rounds a number to the nearest integer ËÄÉáÎåÈëºóÈ¡Õû |
1 | 2 | 3 |
| sin(x) | Returns the sine of a number ·µ»ØÊý×ÖµÄÕýÏÒÖµ |
1 | 2 | 3 |
| sqrt(x) | Returns the square root of a number ·µ»ØÊý×ֵį½·½¸ù |
1 | 2 | 3 |
| tan(x) | Returns the tangent of an angle ·µ»ØÒ»¸ö½Ç¶ÈµÄÕýÇÐÖµ |
1 | 2 | 3 |
| toSource() | Represents the source code of an object ÏÔʾ¶ÔÏóµÄÔ´´úÂë |
1 | 4 | - |
| valueOf() | Returns the primitive value of a Math object ·µ»ØÊýѧ¶ÔÏóµÄÔʼֵ |
1 | 2 | 4 |
| Property ÊôÐÔ |
Description ÃèÊö |
FF | N | IE |
|---|---|---|---|---|
| constructor | A reference to the function that created the object Ëù½¨Á¢¶ÔÏóµÄº¯Êý²Î¿¼ |
1 | 2 | 4 |
| E | Returns Euler's constant (approx. 2.718) ·µ»ØÅ·À³£Êý£¨½üËÆÓÚ2.718£© |
1 | 2 | 3 |
| LN2 | Returns the natural logarithm of 2 (approx. 0.693) ·µ»Ø2 µÄ×ÔÈ»¶ÔÊý£¨½üËÆÖµ£º0.693£© |
1 | 2 | 3 |
| LN10 | Returns the natural logarithm of 10 (approx. 2.302) ·µ»Ø10 µÄ×ÔÈ»¶ÔÊý£¨½üËÆÖµ£º2.302£© |
1 | 2 | 3 |
| LOG2E | Returns the base-2 logarithm of E (approx. 1.414) ·µ»ØÒÔ2Ϊµ×µÄ¶ÔÊýµÄÊýѧ³£Êý£¬±íʾΪlog10e£¨½üËÆÖµ£º1.414£© |
1 | 2 | 3 |
| LOG10E | Returns the base-10 logarithm of E (approx. 0.434) ·µ»ØÒÔ10Ϊµ×µÄ¶ÔÊýµÄÊýѧ³£Êý£¬±íʾΪlog10e£¨½üËÆÖµ£º0.434£© |
1 | 2 | 3 |
| PI | Returns PI (approx. 3.14159) ·µ»ØÔ²ÖÜÂÊPI£¨½üËÆÖµ£º3.14159£© |
1 | 2 | 3 |
| prototype | Allows you to add properties and methods to the object ¿ÉΪ¶ÔÏó¼ÓÈëµÄÊôÐԺͷ½·¨ |
1 | 2 | 4 |
| SQRT1_2 | Returns the square root of 1/2 (approx. 0.707) ·µ»Ø1/2µÄƽ·½¸ù£¨½üËÆÖµ£º0.707£© |
1 | 2 | 3 |
| SQRT2 | Returns the square root of 2 (approx. 1.414) ·µ»Ø2µÄƽ·½¸ù£¨½üËÆÖµ£º1.414£© |
1 | 2 | 3 |