Skip to content

Commit

Permalink
fixed files form Math #54
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent bc7a114 commit 9a489f1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion projects/Math/54/org/apache/commons/math/dfp/Dfp.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ protected Dfp(final DfpField field, double x) {
// Zero or sub-normal
if (x == 0) {
// make sure 0 has the right sign
if ((bits & 0x8000000000000000L) != 0) {
sign = -1;
}
return;
}

Expand Down Expand Up @@ -2316,7 +2319,10 @@ public double toDouble() {

Dfp y = this;
boolean negate = false;
if (lessThan(getZero())) {
int cmp0 = compare(this, getZero());
if (cmp0 == 0) {
return sign < 0 ? -0.0 : +0.0;
} else if (cmp0 < 0) {
y = negate();
negate = true;
}
Expand Down

0 comments on commit 9a489f1

Please sign in to comment.