RFR 7192954+4396272: Fix Float.parseFloat to round correctly and preserve monotonicity

Brian Burkhalter brian.burkhalter at oracle.com
Tue Jun 11 22:47:31 UTC 2013


This contributed patch

http://cr.openjdk.java.net/~bpb/4396272%2b7192954/

fixes these two issues:

1) http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7192954 - Fix Float.parseFloat to round correctly and preserve monotonicity

2) http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4396272 - Parsing double fails to follow IEEE for largest decimal the should yield 0

For 7192954, "stickyRound()" is replaced by actual code development containing a correction loop in floatValue() analogous to that in doubleValue().

For 4396272, when the difference between the scaled big-int versions of the exact value and the candidate double value is exactly 1/2*ULP, and the candidate value <= 2*Double.MIN_NORMAL, then form the correction statement in a way that avoids rounding the intermediate result to zero thereby preventing correction.

For reference see also this thread:

http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-February/014788.html

Thanks,

Brian


More information about the core-libs-dev mailing list