lua math函数库
来源:互联网 发布:淘宝有客服电话 编辑:程序博客网 时间:2024/06/07 17:08
函数名描述示例结果pi圆周率math.pi3.1415926535898abs取绝对值math.abs(-2012)2012ceil向上取整math.ceil(9.1)10floor向下取整math.floor(9.9)9max取参数最大值math.max(2,4,6,8)8min取参数最小值math.min(2,4,6,8)2pow计算x的y次幂math.pow(2,16)65536sqrt开平方math.sqrt(65536)256mod取模math.mod(65535,2)1modf取整数和小数部分math.modf(20.12)20 0.12randomseed设随机数种子math.randomseed(os.time()) random取随机数math.random(5,90)5~90rad角度转弧度math.rad(180)3.1415926535898deg弧度转角度math.deg(math.pi)180expe的x次方math.exp(4)54.598150033144log计算x的自然对数math.log(54.598150033144)4log10计算10为底,x的对数math.log10(1000)3frexp将参数拆成x * (2 ^ y)的形式math.frexp(160)0.625 8ldexp计算x * (2 ^ y)math.ldexp(0.625,8)160sin正弦math.sin(math.rad(30))0.5cos余弦math.cos(math.rad(60))0.5tan正切math.tan(math.rad(45))1asin反正弦math.deg(math.asin(0.5))30acos反余弦math.deg(math.acos(0.5))60atan反正切math.deg(math.atan(1))45 函数名描述示例结果pi圆周率math.pi3.1415926535898abs取绝对值math.abs(-2012)2012ceil向上取整math.ceil(9.1)10floor向下取整math.floor(9.9)9max取参数最大值math.max(2,4,6,8)8min取参数最小值math.min(2,4,6,8)2pow计算x的y次幂math.pow(2,16)65536sqrt开平方math.sqrt(65536)256mod取模math.mod(65535,2)1modf取整数和小数部分math.modf(20.12)20 0.12randomseed设随机数种子math.randomseed(os.time()) random取随机数math.random(5,90)5~90rad角度转弧度math.rad(180)3.1415926535898deg弧度转角度math.deg(math.pi)180expe的x次方math.exp(4)54.598150033144log计算x的自然对数math.log(54.598150033144)4log10计算10为底,x的对数math.log10(1000)3frexp将参数拆成x * (2 ^ y)的形式math.frexp(160)0.625 8ldexp计算x * (2 ^ y)math.ldexp(0.625,8)160sin正弦math.sin(math.rad(30))0.5cos余弦math.cos(math.rad(60))0.5tan正切math.tan(math.rad(45))1asin反正弦math.deg(math.asin(0.5))30acos反余弦math.deg(math.acos(0.5))60atan反正切math.deg(math.atan(1))45
0 0
- LUA函数库math库
- Lua中Math函数库
- Lua的math函数库
- lua math函数库
- lua math函数库
- Lua基础之math(数学函数库)
- Lua基础之math(数学函数库)
- Lua基础之math库总结(数学函数库)
- math函数库
- math.h 数学函数库
- lua math
- lua math
- Lua math
- 【lua】Lua中的table函数库
- LUA中的TABLE函数库
- LUA中的字符串函数库
- LUA中的基本函数库
- LUA中的TABLE函数库
- 获取时间的方式
- Centos6下通过pssh并发执行命令
- Blind Java Deserialization - Part II - exploitation rev 2
- android studio中的Menu
- Objective-C-iOS UIScrollView UIPageControl 的用法详解
- lua math函数库
- materialdesign之tablayout的用法
- 无人驾驶车核心算法 — SLAM
- MongoDB的数据复制和数据切片
- 为web项目搭建sftp服务器
- 一些项目遇到的问题
- 取消应用程序崩溃后弹出的对话框
- 怎样将网络机顶盒usb调试模式打开
- Windows如何上传项目到github