开发者

Why does the modulo function in excel return the divisor?

I have an Excel validation f开发者_JAVA百科ormula 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.


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:

=(1/.05)-(floor(1/.05))

That gives me the zero I need.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜