Closed ingebot closed 1 year ago
Comment author: @guillerodriguez
BigDecimal.toString() and .toEngineeringString() give wrong results when both the value and the scale are negative. These problems are similar to the issue already reported for .toPlainString (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90759).
toString(): If the value and the scale are both negative, the decimal point is always included in the output string, even when not needed:
(unscaledValue: -1, scale: -5) OpenJDK: -1E+5 Classpath: -1.E+5
toEngineeringString(): Same issue already reported for toPlainString:
(unscaledValue: -1, scale: -5) OpenJDK: -100E+3 Classpath: -10E+3
toEngineeringString(): Incorrectly uses exponential notation when exponent is zero:
(unscaledValue: -1, scale: -1) OpenJDK: -10 Classpath: -1E+0
Note: this issue was migrated automatically using bugzilla2github
Original bug ID: BZ#111706 From: @guillerodriguez Reported version: 0.99