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