Wrong Calculation on Round and Compare

Hi!

I’ve the following setting in an Excel document (see below and in the attached file) using Aspose Cells for Java:


CELLNAME FORMULA or VALUE calculated value (Aspose) calculated value (Excel)
A1 -1.0 -1.0 -1.0
A2 1.0 1.0 1.0
A3 =ROUND(A1/1000,0)=ROUND(A2/1000,0) false true
A4 =ROUND(A1/1000,0)=0 false true
A5 =ROUND(A2/1000,0)=0 true true
A6 =ROUND(A1/1000,0)*(-1.0)=0 true true
A7 =ROUND(A2/1000,0)*(-1.0)=0 false true
A8 =ROUND(A1/1000,0) 0.0 0.0
A9 =ROUND(A2/1000,0) 0.0 0.0


it seems that the problem is a kind of “-0” (negative 0) in Aspose…

have you noticed this problem? (of course there’s a workaround in comparing the parts in a different way… substract and abs) but the formulas are defined by someone else


thanks for your help.

Hi,

Thanks for your input file. I have tested your xls file with the latest version and I was able to reproduce this bug.

Please see the code below. I have attached the output files too.

This issue has been logged as CELLSJAVA-29101.

Java


String path=“C:\Documents and Settings\Home\Desktop\Round_compare.xls”;


Workbook workbook = new Workbook();

workbook.open(path);

workbook.calculateFormula();

workbook.save(path + “.out.xls”, FileFormatType.EXCEL97TO2003);

workbook.save(path + “.out.pdf”, FileFormatType.PDF);

Hi,

We have fixed the issue of calculating formula. Please try this new fix.

Please download: Aspose.Cells for Java v2.5.4.13

Hi!
Thanks, I’ll test it for my original problem.
Is there a general description for the problem, which formulas/values have been influenced by this?

Thanks in advance

Hi,

Well, it fixes a bug of comparing -0.0 with 0.0. So, it may influence all the formulas that use comparison with operands like 0.0 and -0.0.

Hi!
Thanks, works for me!
bye Nina

The issues you have found earlier (filed as 29101) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.