为什么Excel中的取模函数返回除数?
我有一个 Excel 验证公式,在 Office '03、'07 中运行良好,但在 2010 年失败。他们最近是否更改了 MOD 的定义?
在 03/07 中,以下内容返回零:
=MOD(1, .05)
但是在 2010 年,它返回 .05
。
据我所知,自从我三年级时了解余数以来,它们并没有改变它们的工作方式。然而,微软可能采取了一定的自由。
I have an Excel validation formula which worked fine in Office '03, '07, but is failing in 2010. Did they change the definition of MOD recently?
In 03/07 the following returns zero:
=MOD(1, .05)
However in 2010 it returns .05
.
As far as I can tell they haven't changed how remainders worked since I was in 3rd grade when I learned about them. However, Microsoft may be taking certain liberties.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际上...在Office 2007中它不会返回零,而是-0.000000000000000056(刚刚测试过)。
也许是浮点问题或 Excel 2010 处理浮点的方式发生了变化。
Actually... it does not return zero in Office 2007, but -0.000000000000000056 (just tested).
Maybe it's a floating point issue or the way Excel 2010 handles floating point changed.
所以我最终决定确定这一点的最佳方法是作弊并执行:
这给了我所需的零。
So I finally decided the best way to determine this was to cheat and do:
That gives me the zero I need.