math.pow with Logitech G-Hub

坚强是说给别人听的谎言 提交于 2021-02-05 08:09:13

问题


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

The error code was:

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


回答1:


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

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



来源:https://stackoverflow.com/questions/65664703/math-pow-with-logitech-g-hub

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!