Bug 61064

Summary: Update CEILING to match later versions of Excel
Product: POI Reporter: vertexshader256
Component: SS CommonAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: P2    
Version: 3.16-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
URL: https://exceltutorialonline.com/excel-if-statement-multiple-conditions-range/

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.