Bug 61064 - Update CEILING to match later versions of Excel
Summary: Update CEILING to match later versions of Excel
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: 3.17-FINAL
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL: https://exceltutorialonline.com/excel...
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-03 13:54 UTC by vertexshader256
Modified: 2019-12-20 19:47 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vertexshader256 2017-05-03 13:54:43 UTC
The CEILING function in MathX needs to allow a negative number argument and a positive significance.

= CEILING(-11.12333, 0.03499)
= -11.09183

Test within testCeiling() which should be failing:
d = -11.12333; s = 0.03499;
assertEquals("ceiling ", Double.NaN, MathX.ceiling(d, s));

The logic within ceiling() should be changed to:
if (n>0 && s<0) {
    c = Double.NaN;
}

More info:
http://www.excelfunctions.net/Excel-Ceiling-Function.html
Comment 1 Dominik Stadler 2017-09-28 14:46:25 UTC
Applied via r1810007, thanks for the suggestion.