[Bug 62839] New: MathX.floor for negative n

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 62839] New: MathX.floor for negative n

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=62839

            Bug ID: 62839
           Summary: MathX.floor for negative n
           Product: POI
           Version: 4.0.0-FINAL
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SS Common
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

Behavior in LibreOffice / Excel:
The result of function call FLOOR.XCL(-123;10) in LibreOffice 6.1.2.1 is -130.
The result in Excel Office 365 is also -130.
The result in POI 4.0.0 via cell.getNumericCellValue() is -130.0.

Problem:
The result of new DataFormatter().formatCellValue(cell, formulaEvaluator) is
#NUM!.

Expected result:
I suppose that the result in POI also should be -130.

Idea for improvement:
Remove the condition (n<0 && s>0) in the if-statement in
org.apache.poi.ss.formula.functions.MathX.floor(double, double)

And I suggest that the condition (s==0 && n!=0) in
org.apache.poi.ss.formula.functions.MathX.floor(double, double) could be
removed also. Excel returns 0 for floor(0;10) and LibreOffice also returns 0.

I guess that org.apache.poi.ss.formula.functions.MathX.ceiling(double, double)
has already been changed this way, because the docs tell about negative n, but
the if-statement does not check that.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 62839] MathX.floor for negative n

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=62839

Dominik Stadler <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Dominik Stadler <[hidden email]> ---
Fixed via r1849764.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 62839] MathX.floor for negative n

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=62839

--- Comment #2 from Sven <[hidden email]> ---
Thank you! :-)

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]