LUA 数据比较BUG?????是不是BUG大佬帮看看

function test(money)
	for i=1,0.1,-0.1 do 
	   if tonumber(money) >= tonumber(i*9)  then
	   		return i
	   end
	end
	return 0
end

print(test(0.9)) //执行结果 0

print(_VERSION) //执行结果 Lua 5.3

//输出结果0 预期结果应该是0.1才对吧

 

求大佬解释解释,

posted @ 2019-08-15 04:10  吕布v1.0  阅读(182)  评论(0编辑  收藏  举报