[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/111706] New: BigDecimal.toString() and .toEngineeringStri
From: |
guillerodriguez.dev at gmail dot com |
Subject: |
[Bug classpath/111706] New: BigDecimal.toString() and .toEngineeringString() give wrong results for negative values |
Date: |
Thu, 05 Oct 2023 15:32:05 +0000 |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111706
Bug ID: 111706
Summary: BigDecimal.toString() and .toEngineeringString() give
wrong results for negative values
Product: classpath
Version: 0.99
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: classpath
Assignee: unassigned at gcc dot gnu.org
Reporter: guillerodriguez.dev at gmail dot com
Target Milestone: ---
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug classpath/111706] New: BigDecimal.toString() and .toEngineeringString() give wrong results for negative values,
guillerodriguez.dev at gmail dot com <=