src/share/classes/sun/misc/FDBigInteger.java

Print this page
rev 7487 : 7192954: Fix Float.parseFloat to round correctly and preserve monotonicity.
4396272: Parsing doubles fails to follow IEEE for largest decimal that should yield 0
7039391: Use Math.ulp in FloatingDecimal
Summary: Correct rounding and monotonicity problems in floats and doubles
Reviewed-by: martin
Contributed-by: Dmitry Nadezhin <dmitry.nadezhin@oracle.com>, Louis Wasserman <lowasser@google.com>

*** 780,790 **** @*/ public FDBigInteger leftInplaceSub(FDBigInteger subtrahend) { assert this.size() >= subtrahend.size() : "result should be positive"; FDBigInteger minuend; if (this.isImmutable) { ! minuend = new FDBigInteger(this.data, this.offset); } else { minuend = this; } int offsetDiff = subtrahend.offset - minuend.offset; int[] sData = subtrahend.data; --- 780,790 ---- @*/ public FDBigInteger leftInplaceSub(FDBigInteger subtrahend) { assert this.size() >= subtrahend.size() : "result should be positive"; FDBigInteger minuend; if (this.isImmutable) { ! minuend = new FDBigInteger(this.data.clone(), this.offset); } else { minuend = this; } int offsetDiff = subtrahend.offset - minuend.offset; int[] sData = subtrahend.data;
*** 849,859 **** @*/ public FDBigInteger rightInplaceSub(FDBigInteger subtrahend) { assert this.size() >= subtrahend.size() : "result should be positive"; FDBigInteger minuend = this; if (subtrahend.isImmutable) { ! subtrahend = new FDBigInteger(subtrahend.data, subtrahend.offset); } int offsetDiff = minuend.offset - subtrahend.offset; int[] sData = subtrahend.data; int[] mData = minuend.data; int subLen = subtrahend.nWords; --- 849,859 ---- @*/ public FDBigInteger rightInplaceSub(FDBigInteger subtrahend) { assert this.size() >= subtrahend.size() : "result should be positive"; FDBigInteger minuend = this; if (subtrahend.isImmutable) { ! subtrahend = new FDBigInteger(subtrahend.data.clone(), subtrahend.offset); } int offsetDiff = minuend.offset - subtrahend.offset; int[] sData = subtrahend.data; int[] mData = minuend.data; int subLen = subtrahend.nWords;