Bug 98609 - MOD function does not work
MOD function does not work
 Status: RESOLVED DUPLICATE of bug 88945 None LibreOffice Unclassified Documentation (show other bugs) 5.0.5.2 release All All medium normal Not Assigned

 Reported: 2016-03-11 19:27 UTC by Brent 2016-03-12 19:04 UTC (History) 3 users (show) jmadero.dev olivier.hallot rb.henschel

Attachments

 Note You need to log in before you can comment on or make changes to this bug.
 Brent 2016-03-11 19:27:08 UTC ```https://help.libreoffice.org/Calc/Mathematical_Functions#MOD MOD Returns the remainder when one integer is divided by another. Syntax MOD(Dividend; Divisor) For integer arguments this function returns Dividend modulo Divisor, that is the remainder when Dividend is divided by Divisor. This function is implemented as Dividend - Divisor * INT(Dividend/Divisor) , and this formula gives the result if the arguments are not integer. Example =MOD(22;3) returns 1, the remainder when 22 is divided by 3. =MOD(11.25;2.5) returns 1.25. The results are not correct for a MOD function. If the formula provided is truly the one being used then it is wrong. A corrected formula would be (Dividend/Divisor)-INT(Dividend/Divisor) That will give the remainder which is being searched for when using this math function. Version: 5.0.5.2 Build ID: 55b006a02d247b5f7215fc6ea0fde844b30035b3 Locale: en-US (en_US)``` Brent 2016-03-11 19:30:02 UTC ```Syntax MOD(Dividend; Divisor) This example is wrong. The spreadsheet requires it to be MOD(Dividend,Divisor) If a semi colon is used it is automatically replaced with a comma.``` Joel Madero 2016-03-11 21:24:39 UTC `This just seems like a documentation error so I'm punting to them.` Regina Henschel 2016-03-12 17:55:54 UTC `Which separator is used between function arguments is a user setting in Tools > Options > LibreOffice Calc > Formula. The help texts always assume a semicolon as separator. Currently it is not possible to depend the help texts on the user setting, and there exists no plans to implement such feature.` Stanislav Horacek 2016-03-12 18:01:43 UTC ```I suppose this can be marked as duplicate of a generic bug about argument separators in UI vs. in Help. *** This bug has been marked as a duplicate of bug 88945 ***``` Joel Madero 2016-03-12 18:05:40 UTC ```If I read the issue right that was only one of the issues reported: "This function is implemented as Dividend - Divisor * INT(Dividend/Divisor) , and this formula gives the result if the arguments are not integer." "A corrected formula would be (Dividend/Divisor)-INT(Dividend/Divisor)"``` Regina Henschel 2016-03-12 19:04:52 UTC ```The MOD function is implemented same as in other spreadsheet applications like Excel, Gnumeric or Google tables and as the % operator in programming languages. The suggestion of the reporter would give the fractional part of the quotient, but not the remainder. Perhaps the reporter confuses it with the function modf in C/C++.```