Page 1 of 1

[Java] ".computeFunction(GeneralFunction.STDEV)"

Posted: Sat May 09, 2009 4:04 am
by FumiC1980
Hello!

When I use ".computeFunction(GeneralFunction.STDEV)" to calculate the standard deviation of a dataset, something goes wrong:

Code: Select all

// Get an interface for calculations with 'xCellRange'
XSheetOperation xCellRangeOperate = (XSheetOperation) UnoRuntime.queryInterface(XSheetOperation.class, xCellRange);

// Calculate the standard deviation of elements in 'xCellRange'
xCellRangeStdev =  xCellRangeOperate.computeFunction(GeneralFunction.STDEV);

// Use this for later calculations
return xCellRangeStdev;
If N={2;4;6}, the standard deviation would be "2" - but this method returns something like "6.92126369412475E-310".

:o

The same sourcecode would work just fine with counting the number of elements in 'xCellRange' using the same Method but a different constant (e.g. "GeneralFunction.COUNTNUMS"):

Code: Select all

xCellRangeStdev =  xCellRangeOperate.computeFunction(GeneralFunction.COUNTNUMS);
and the result would be n=3, of course.

Here is my system:
OpenOffice 3.0.1
Ubuntu 9.04 Jaunty
Netbeans 6.5
Java SE 1.6.0_13

Does anyone have a clue, what's going on there? :ugeek:
Are there any alternatives in implementing this function with Java?

Sincerely
Christian

Re: [Java] ".computeFunction(GeneralFunction.STDEV)"

Posted: Sat May 09, 2009 4:05 pm
by B Marcelly
Hi,
Similar problem with a Basic code.
It's a known bug : Issue 22625
This report is still uncorrected after 5 and a half years... :evil:
Developers are more interested in adding new (often buggy) features than make already available features work correctly.
______
Bernard

Re: [Java] ".computeFunction(GeneralFunction.STDEV)"

Posted: Sat May 09, 2009 7:29 pm
by FumiC1980
B Marcelly wrote:This report is still uncorrected after 5 and a half years... :evil:
Developers are more interested in adding new (often buggy) features than make already available features work correctly.
Hard to believe, but it seems - you're absolutely right! :lol:

The only thing I can do to improve this situation is to file another bug report for OOo:
Issue 101713.

Cross your fingers, light a candle (christian tradition) or simply wish me luck!
;)