您的位置:首页 > 移动开发 > Objective-C

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

Properties

Syntax: object.property_name
PropertyDescriptionNNIE 
EReturns the base of a natural logarithm23
LN2Returns the natural logarithm of 223
LN10Returns the natural logarithm of 1023
LOG2EReturns the base-2 logarithm of E23
LOG10EReturns the base-10 logarithm of E23
PIReturns PI23
SQRT1_2Returns 1 divided by the square root of 223
SQRT2Returns the square root of 223

Methods

Syntax: object.method_name()

MethodDescriptionNNIE
abs(x)Returns the absolute value of x23
acos(x)Returns the arccosine of x23
asin(x)Returns the arcsine of x23
atan(x)Returns the arctangent of x23
atan2(y,x)Returns the angle from the x axis to a point23
ceil(x)Returns the nearest integer greater than or equal to x23
cos(x)Returns the cosine of x23
exp(x)Returns the value of E raised to the power of x23
floor(x)Returns the nearest integer less than or equal to x23
log(x)Returns the natural log of x23
max(x,y)Returns the number with the highest value of x and y23
min(x,y)Returns the number with the lowest value of x and y23
pow(x,y)Returns the value of the number x raised to the power of y23
random()Returns a random number between 0 and 123
round(x)Rounds x to the nearest integer23
sin(x)Returns the sine of x23
sqrt(x)Returns the square root of x23
tan(x)Returns the tangent of x23
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐