JS math 对象方法

abs    返回数字的绝对值。  Math.abs(number) 

acos   返回数的反余弦值。  Math.acos(number)

asin   返回数字的反正弦值。 Math.asin(number) 

atan   返回数字的反正切值。  Math.atan(number)

atan2  返回由 X 轴到 (y,x) 点的角度(以弧度为单位)。 Math.atan2(y, x)

ceil   返回大于等于其数字参数的最小整数。  Math.ceil(number)

cos    返回数的余弦值。   Math.cos(number)

exp  返回 e(自然对数的底)的幂。  Math.exp(number)

floor    返回小于等于其数值参数的最大整数。  Math.floor(number)

log     返回数字的自然对数。  Math.log(number)

max   返回给出的零个或多个数值表达式中较大者。 Math.max(num1,num2,num3,num4);

min    返回给出的零个或多个数值表达式中较小的值。 Math.min(num1,num2,num3,num4);

pow    返回底表达式的指定次幂。  Math.pow(base, exponent); base--表达式低值    exponent--表达式的指数值

random    返回介于 01 之间的伪随机数。  Math.random( )

round   返回与给出的数值表达式最接近的整数   Math.round(number);

sqrt    返回数字的平方根。   Math.sqrt(number)

sin    返回数字的正弦值。 Math.sin(number) 

tan     返回数字的正切值。   Math.tan(number)
原文地址:https://www.cnblogs.com/bruce-gou/p/5727588.html