math对象的属性和方法

math对象的属性和方法

  Math . pI():弧度的π

  Math . sqrt():返回平方根

    

  Math . abs(x):返回x的绝对值

    

  Matn . ceil(x):返回x的上舍入

    

  Math . floor():返回x的下舍入

    

  Math . max(a,b,c,d):返回a,b,c,d中的最大值

    

  Math . min(a,b,c,d):返回a,b,c,d中的最小值

    

  Math . random():返回0-1之间的随机数

    

  Math . round(x):返回对x四舍五入后的数值

    

  Math . sin(x):返回x的正弦值

  Math . cos(x):返回x的余弦值

  Math . tan(x):返回x的正切值

  Math . asin(x):返回x的反正弦值

  Math . acos(x):返回x的反余弦值

  Math . atan(x):返回x的反正切值

原文地址:https://www.cnblogs.com/yanghuiting/p/10154546.html