Skip to content

Commit

Permalink
Merge branch 'fix_NUMBERS-87__roman'
Browse files Browse the repository at this point in the history
Closes #25.
  • Loading branch information
Gilles Sadowski committed Dec 23, 2018
2 parents c64fa8a + e29dff1 commit d6d7b04
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ public boolean equals(Object other) {
return true;
}
if (other instanceof PlaneAngle){
return Double.valueOf(value).equals(Double.valueOf(((PlaneAngle) other).value));
return Double.doubleToLongBits(value) ==
Double.doubleToLongBits(((PlaneAngle) other).value);
}
return false;
}

/** {@inheritDoc} */
@Override
public int hashCode() {
return Double.valueOf(value).hashCode();
return Double.hashCode(value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ private static void checkNotNegative(double arg) {
* @return {@code Double.valueof(x).equals(Double.valueOf(y))}
*/
private static boolean equals(double x, double y) {
return Double.valueOf(x).equals(Double.valueOf(y));
return Double.doubleToLongBits(x) == Double.doubleToLongBits(y);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public boolean equals(Object other) {
/** {@inheritDoc} */
@Override
public int hashCode() {
return Double.valueOf(value).hashCode();
return Double.hashCode(value);
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
*/
public class FP64Field extends AbstractField<FP64> {
/** 0d */
private static final FP64 ZERO = new FP64(Double.valueOf(0));
private static final FP64 ZERO = new FP64(0.);
/** 1d */
private static final FP64 ONE = new FP64(Double.valueOf(1));
private static final FP64 ONE = new FP64(1.);

/** {@inheritDoc} */
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ public static double value(double a,
return 0;
} else if (x >= a + 1) {
// Q should converge faster in this case.
final RegularizedGamma.Q q = new RegularizedGamma.Q();
return 1 - q.value(a, x, epsilon, maxIterations);
return 1 - RegularizedGamma.Q.value(a, x, epsilon, maxIterations);
} else {
// Series.
double n = 0; // current element index
Expand Down Expand Up @@ -167,8 +166,7 @@ public static double value(final double a,
return 1;
} else if (x < a + 1) {
// P should converge faster in this case.
final RegularizedGamma.P p = new RegularizedGamma.P();
return 1 - p.value(a, x, epsilon, maxIterations);
return 1 - RegularizedGamma.P.value(a, x, epsilon, maxIterations);
} else {
final ContinuedFraction cf = new ContinuedFraction() {
/** {@inheritDoc} */
Expand Down

0 comments on commit d6d7b04

Please sign in to comment.