https://bugs.documentfoundation.org/show_bug.cgi?id=141200

--- Comment #4 from Rafael Lima <[email protected]> ---
> you will get results consistent with VBA's.
> So the help should just reflect the correct intended result (rounding of
> both operands before Mod), and bug 141201 should resolve the inconsistency.

Hi Mike. Now I understood where the problem is. I initially thought VBA rounded
the remainder to the nearest integer. But from your explanation (and after
reading more carefully [2]) both VBA and LO Basic (if variables are used) first
round each variable to the nearest integer and then apply the MOD operator.

Here's the example to demonstrate this:

Sub ExampleMod2
   a = 16.4
   b = 5.9
   Print a Mod b 'Prints 4
End Sub

It should be noted that BASIC's MOD operator has a different behavior than
Calc's MOD function. In Calc =MOD(16.4;5.9) returns 4.6.

I'll update the help file to clarify these issues.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to