You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2012/08/17 02:57:35 UTC

Re: svn commit: r1374071 - in /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss: LegendreHighPrecisionRuleFactory.java LegendreRuleFactory.java

On 16 August 2012 22:35,  <er...@apache.org> wrote:
> Author: erans
> Date: Thu Aug 16 21:35:14 2012
> New Revision: 1374071
>
> URL: http://svn.apache.org/viewvc?rev=1374071&view=rev
> Log:
> Change suggested by "FindBugs".
>
> Modified:
>     commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java
>     commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreRuleFactory.java
>
> Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java
> URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java?rev=1374071&r1=1374070&r2=1374071&view=diff
> ==============================================================================
> --- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java (original)
> +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java Thu Aug 16 21:35:14 2012
> @@ -193,7 +193,7 @@ public class LegendreHighPrecisionRuleFa
>              weights[idx] = tmp2;
>          }
>          // If "numberOfPoints" is odd, 0 is a root.
> -        if (numberOfPoints % 2 == 1) {
> +        if (numberOfPoints % 2 != 0) {

Maybe add a comment to say why the comparison is done this way?
Finding the associated SVN log comment would be hard work in the future.

>              BigDecimal pmc = BigDecimal.ONE;
>              for (int j = 1; j < numberOfPoints; j += 2) {
>                  final BigDecimal b_j = new BigDecimal(j, mContext);
>
> Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreRuleFactory.java
> URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreRuleFactory.java?rev=1374071&r1=1374070&r2=1374071&view=diff
> ==============================================================================
> --- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreRuleFactory.java (original)
> +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreRuleFactory.java Thu Aug 16 21:35:14 2012
> @@ -129,7 +129,7 @@ public class LegendreRuleFactory extends
>              weights[idx] = w;
>          }
>          // If "numberOfPoints" is odd, 0 is a root.
> -        if (numberOfPoints % 2 == 1) {
> +        if (numberOfPoints % 2 != 0) {
>              double pmc = 1;
>              for (int j = 1; j < numberOfPoints; j += 2) {
>                  pmc = -j * pmc / (j + 1);
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: svn commit: r1374071 - in /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss: LegendreHighPrecisionRuleFactory.java LegendreRuleFactory.java

Posted by Gilles Sadowski <gi...@harfang.homelinux.org>.
On Fri, Aug 17, 2012 at 01:57:35AM +0100, sebb wrote:
> On 16 August 2012 22:35,  <er...@apache.org> wrote:
> > Author: erans
> > Date: Thu Aug 16 21:35:14 2012
> > New Revision: 1374071
> >
> > URL: http://svn.apache.org/viewvc?rev=1374071&view=rev
> > Log:
> > Change suggested by "FindBugs".
> >
> > Modified:
> >     commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java
> >     commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreRuleFactory.java
> >
> > Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java
> > URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java?rev=1374071&r1=1374070&r2=1374071&view=diff
> > ==============================================================================
> > --- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java (original)
> > +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java Thu Aug 16 21:35:14 2012
> > @@ -193,7 +193,7 @@ public class LegendreHighPrecisionRuleFa
> >              weights[idx] = tmp2;
> >          }
> >          // If "numberOfPoints" is odd, 0 is a root.
> > -        if (numberOfPoints % 2 == 1) {
> > +        if (numberOfPoints % 2 != 0) {
> 
> Maybe add a comment to say why the comparison is done this way?
> Finding the associated SVN log comment would be hard work in the future.

Done in revision 1374187.

Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org