lua math.fmod使用注意小數:--Returns the remainder of the division of x by y.function math.fmod (x, y) end //取模運算這里需要注意小數的問題,看下面兩個例子:1、local x = math.fmod(15, 4)print(x)結果:42、local x = math.fmod(15.3, 4)print(x)結果:3.33、local x = math.fmod(15, 4.1)print(x)結果:2.7
新聞熱點
疑難解答