Modulo operator in Basic cannot deal with decimal numbers. Whereas the help text states: Print 10 Mod 2.5 ' returns 0 actual result of 10 Mod 2.5 is 1 (2.5 is apparently rounded up to 3). (Contrary to this, MOD function in Calc returns 0 in this example.) I'm not sure what behaviour should be considered as reference. In any case, either Mod operator or its description in help should be corrected. Tested on 4.2.6 and 3.5.4, probably inherited from OOo.
Indeed present in 3.3.0 already thanks!
*** Bug 89603 has been marked as a duplicate of this bug. ***
Not dup of fdo#50299 since we just talk about doc here which indicates something different from what LO really does. BTW, in Calc part, Mod(10;2.5) returns 0
Just for information, I submitted this patch for review: https://gerrit.libreoffice.org/#/c/14611/ Hope it'll be ok :-)
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=0f79a5ff07e5b392044726b657998561cbe97fda tdf#84435: Mod operator does not deal with decimals as described in help It will be available in 5.0.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-4-4": http://cgit.freedesktop.org/libreoffice/core/commit/?id=b51a30504ec3c00b0bad616817471aa01918e06e&h=libreoffice-4-4 tdf#84435: Mod operator does not deal with decimals as described in help It will be available in 4.4.4. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Checked in master, everything as expected. Thanks, Julien, nice work!
You're welcome :-) Following your feedback, let's put this one to VERIFIED
This was completely NAB (and in fact, the underlying problem was tdf#141200, which was a *documentation* problem). The change was wrong. It created a regression tdf#141201 :-)