Skip to content

Commit

Permalink
Fixed PMD warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
maisonobe committed Jul 30, 2021
1 parent 7c3e638 commit c67c5bf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ protected double[] findRoots(final int n, final UnivariateFunction ratioEvaluato
// use Aberth method to find all roots simultaneously
final double[] ratio = new double[n];
final Incrementor incrementor = new Incrementor(1000);
double tol = Double.NaN;
double maxOffset = Double.NaN;
double tol;
double maxOffset;
do {

// safety check that triggers an exception if too much iterations are made
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ protected T[] findRoots(final int n, final CalculusFieldUnivariateFunction<T> ra
// use Aberth method to find all roots simultaneously
final T[] ratio = MathArrays.buildArray(field, n);
final Incrementor incrementor = new Incrementor(1000);
double tol = Double.NaN;
double maxOffset = Double.NaN;
double tol;
double maxOffset;
do {

// safety check that triggers an exception if too much iterations are made
Expand Down
3 changes: 2 additions & 1 deletion hipparchus-core/src/main/java/org/hipparchus/dfp/Dfp.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ protected Dfp(final DfpField field, long x) {
protected Dfp(final DfpField field, double x) {

// initialize as if 0
sign = 1;
mant = new int[field.getRadixDigits()];
this.field = field;

Expand All @@ -282,6 +281,8 @@ protected Dfp(final DfpField field, double x) {
// make sure 0 has the right sign
if ((bits & 0x8000000000000000L) != 0) {
sign = -1;
} else {
sign = 1;
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,16 @@ public BigReal(char[] in, MathContext mc) {
/** Build an instance from a double.
* @param val value of the instance
*/
public BigReal(double val) { // NOPMD - we really want double conversion here
d = new BigDecimal(val);
public BigReal(double val) {
d = new BigDecimal(val); // NOPMD - we really want double conversion here
}

/** Build an instance from a double.
* @param val value of the instance
* @param mc context to use
*/
public BigReal(double val, MathContext mc) { // NOPMD - we really want double conversion here
d = new BigDecimal(val, mc);
public BigReal(double val, MathContext mc) {
d = new BigDecimal(val, mc); // NOPMD - we really want double conversion here
}

/** Build an instance from an int.
Expand Down

0 comments on commit c67c5bf

Please sign in to comment.