LUA(Corona SDK)中math.floor()为何在0.1增量时返回错误值?

2026-06-05 12:474阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计611个文字,预计阅读时间需要3分钟。

LUA(Corona SDK)中math.floor()为何在0.1增量时返回错误值?

当我在每次增加0.1的双倍值上使用Math.floor函数时,我遇到了一个奇怪的错误。它仅当增量是0.1且从值5开始时发生。例如,math.floor(4)返回4,但math.floor(5)返回4+1。

阅读全文