math对象方法

math对象方法:

  math.abs(x)     返回x的绝对值

  math.ceil(x)      返回x的上舍入

  math.floor(x)  返回x的下舍入

  math.max()      返回最大值   (必须是数字)

  math.min()    返回最小值

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

  math.round()  返回四舍五入的值

  math.PI         返回π

  math.sqrt(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/bokeyanghao/p/10133579.html