lua的 math库
来源:互联网 发布:数据库增删改查 编辑:程序博客网 时间:2024/06/07 01:06
函数名描述示例结果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库
- lua math库
- Lua math 库
- lua math库
- LUA函数库math库
- Lua math 库
- 【转】Lua math库
- Lua math 库
- lua math库
- lua math库
- lua math库
- android 翻转效果动画源码
- POJ 2375 Cow Ski Area(强连通)
- ARM--交叉编译器及开发板系统的安装
- Redis 3.0官方文档翻译计划(2)——数据类型初探
- java自带线程池和队列详细讲解
- lua的 math库
- Lua弱表Weak table
- opencv 基本包
- 阻塞IO的理解
- mongodb单机修改为副本集的步骤
- SqlServer中获取当前会话链接的客户端信息及触发器有关注意事项
- MPI并行程序设计——Eclipse开发环境的搭建
- 腾飞神途
- Redis 3.0官方文档翻译计划(3)——从入门到精通(上)