Code comment.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1374187 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gilles Sadowski 2012-08-17 09:50:54 +00:00
parent 64a7948cee
commit bd59fee7a6
2 changed files with 6 additions and 0 deletions

View File

@ -193,6 +193,9 @@ public class LegendreHighPrecisionRuleFactory extends BaseRuleFactory<BigDecimal
weights[idx] = tmp2;
}
// If "numberOfPoints" is odd, 0 is a root.
// Note: as written, the test for oddness will work for negative
// integers too (although it is not necessary here), preventing
// a FindBugs warning.
if (numberOfPoints % 2 != 0) {
BigDecimal pmc = BigDecimal.ONE;
for (int j = 1; j < numberOfPoints; j += 2) {

View File

@ -129,6 +129,9 @@ public class LegendreRuleFactory extends BaseRuleFactory<Double> {
weights[idx] = w;
}
// If "numberOfPoints" is odd, 0 is a root.
// Note: as written, the test for oddness will work for negative
// integers too (although it is not necessary here), preventing
// a FindBugs warning.
if (numberOfPoints % 2 != 0) {
double pmc = 1;
for (int j = 1; j < numberOfPoints; j += 2) {