You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Torbjørn G. Dahle" <tg...@origin.no> on 2009/05/15 11:00:29 UTC

-0.0 equals 0.0 in Excel, but not in POI

I've spent some time troubleshooting a POI parsing error, and I found that in
Excel the following expression,

=-SUM( ...

, where the SUM function returns 0, the result is 0. However in POI, the value
is the double -0.0. When this is later used in an IF evaluation, Excel gets a
true (0 == 0), but POI gets a false (-0.0 != 0.0), which means the calculations
are all wrong.

I fixed this by replacing the expression in the Excel file with

=0-SUM(...

, but I guess this is a bug.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: -0.0 equals 0.0 in Excel, but not in POI

Posted by "Torbjørn G. Dahle" <tg...@origin.no>.
Nick Burch <nick <at> torchbox.com> writes:

> Any chance you could upload the problem file to a new bug on bugzilla? 

Done and done: http://issues.apache.org/bugzilla/show_bug.cgi?id=47198


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: -0.0 equals 0.0 in Excel, but not in POI

Posted by Nick Burch <ni...@torchbox.com>.
On Fri, 15 May 2009, Torbjørn G. Dahle wrote:
> Sorry forgot to mention that this is running 3.5. beta 5, and the file 
> is XLS.

Any chance you could upload the problem file to a new bug on bugzilla? 
That way it won't get forgotten, and we'll have something to base a unit 
test on

Thanks
Nick

Re: -0.0 equals 0.0 in Excel, but not in POI

Posted by "Torbjørn G. Dahle" <tg...@origin.no>.
Torbjørn G. Dahle <tgdahle <at> origin.no> writes:

> 
> , but I guess this is a bug.
> 

Sorry forgot to mention that this is running 3.5. beta 5, and the file is XLS.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org