https://bugs.documentfoundation.org/show_bug.cgi?id=147089
Bug ID: 147089
Summary: Incorrect handling of right-hand argument to "\"
Integral Division BASIC operator
Product: LibreOffice
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Consider the code:
Sub testIntDiv()
MsgBox 5 / 4 & Chr(10) & _
5 \ 4 & Chr(10) & _
7 / 4 & Chr(10) & _
7 \ 4 & Chr(10) & _
7 / 3.5 & Chr(10) & _
7 \ 3.5 & Chr(10) & _
6.5 / 3.5 & Chr(10) & _
6.5 \ 3.5 & Chr(10)
End Sub
It is intended to give the following result:
1,25
1
1,75
1
2
1
1,85714285714286
1
Instead, it produces
1,25
1
1,75
1
2
2
1,85714285714286
2
See how '7 \ 3.5' and '6.5 \ 3.5' produce 2 instead of expected 1 - according
to the proper "first round both operands to nearest integer, then return
truncated result of division". Note that even using 3.9 instead of 3.5 gives
the same wrong result.
This also deviates from VBA.
--
You are receiving this mail because:
You are the assignee for the bug.