To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=75536
                 Issue #|75536
                 Summary|Quotient and rest calculations
               Component|Spreadsheet
                 Version|OOo 2.1
                Platform|All
                     URL|
              OS/Version|All
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|programming
             Assigned to|spreadsheet
             Reported by|romolo





------- Additional comments from [EMAIL PROTECTED] Mon Mar 19 21:58:51 +0000 
2007 -------
The calculation of quotient and remainder should follow their definition in the
following theorem:
Given two integers a and d, with |d| ≠ 0
There exist unique integers q and r such that a = qd + r and 0 ≤ r < |d|, where
|d| denotes the absolute value of d.

The integer

    * q is called the quotient
    * r is called the remainder
    * d is called the divisor
    * a is called the dividend

while openoffice respect the theorem for d>0 some problem arise when both a and
d are less then 0.
Ie 
q=quotient(-5;-3)=1
r=rest(-5;-3)=-2
But according to the previous definition it should be 0 ≤ r < | d |.
from a mathematical point of view the correct solution should be:
q=quotient(-5;-3)=2
r=rest(-5;-3)=1

as can be verified by:
-5=-3*2+1

Also MS Excel behaves in the same (wrong) way.
A possible solution could be to keep compatibility with excel to implement an
optional mode parameter like in roundup function.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to