Skip to content

Commit

Permalink
refs #11164. fix error < 0
Browse files Browse the repository at this point in the history
The errors are always going to be >= 0, so no point checking if they are < 0. MDHistoWorkspaceIterator does not define getErrorSquared(), and this issue is about fixing cppcheck issues, so I'm not adding those features here.
  • Loading branch information
OwenArnold committed Feb 26, 2015
1 parent 2fd1c92 commit ca3b293
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/MDAlgorithms/src/WeightedMeanMD.cpp
Expand Up @@ -59,10 +59,10 @@ void WeightedMeanMD::execHistoHisto(
double e = rhs_err_sq * lhs_err_sq / (rhs_err_sq + lhs_err_sq);
signal = s * e;
error_sq = e;
} else if ((rhs_err > 0) && (lhs_err <= 0)) {
} else if ((rhs_err > 0) && (lhs_err == 0)) {
signal = rhs_s;
error_sq = rhs_err * rhs_err;
} else if ((lhs_err > 0) && (rhs_err <= 0)) {
} else if ((lhs_err > 0) && (rhs_err == 0)) {
signal = lhs_s;
error_sq = lhs_err * lhs_err;
}
Expand Down

0 comments on commit ca3b293

Please sign in to comment.