forked from hummel/PR1-Spreadsheet
stabw() Methode ergänzt
parent
a0117ae961
commit
c980006f02
|
@ -231,9 +231,22 @@ public class Spreadsheet {
|
||||||
* @return The standard deviation calculated.
|
* @return The standard deviation calculated.
|
||||||
*/
|
*/
|
||||||
private long stabw(String startCellName, String endCellName) {
|
private long stabw(String startCellName, String endCellName) {
|
||||||
|
long mean = mit(startCellName, endCellName);
|
||||||
|
long counter = counterOfCellsWithValue(startCellName, endCellName);
|
||||||
|
long result = 0;
|
||||||
|
|
||||||
|
for(char col = startCellName.charAt(0); col <= endCellName.charAt(0); col++) {
|
||||||
|
|
||||||
return 0;
|
for (int row = Integer.parseInt(startCellName.substring(1)); row <= Integer.parseInt(endCellName.substring(1)); row++) {
|
||||||
|
|
||||||
|
String value = get((row - 1), (col - 'A'));
|
||||||
|
|
||||||
|
if(!value.isEmpty()){
|
||||||
|
result += (long) Math.pow(Long.parseLong(value) - mean, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (long) Math.sqrt(result / counter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue