math.pow 与罗技 G-Hub [英] math.pow with Logitech G-Hub

查看:41
本文介绍了math.pow 与罗技 G-Hub的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不确定如何修复此错误.我读到有变化,但不知道如何解决.

Not to sure how to fix this error. I read there was a change but have no idea how to fix it.

function convert_sens(unconvertedSens) 
    return 0.002 * math.pow(10, unconvertedSens / 50) end

错误代码是:

尝试调用一个 nil 值(字段 'pow')

attempt to call a nil value (field 'pow')

推荐答案

math.pow 自 Lua 5.3 起已弃用,即使您的框架不提供任何数学库,也只需使用求幂运算符 <代码>^.

math.pow is deprecated since Lua 5.3 and even if your framework doesn't provide any math library simply use the exponentiation operator ^.

所以不要用 math.pow(x, y) 简单地写 x^y

So instead of math.pow(x, y) simply write x^y

这篇关于math.pow 与罗技 G-Hub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆