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

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

问题描述

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

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

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

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