GCC Bugzilla – Attachment 11397 Details for
Bug 27311
DecimalFormat problem
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix
pr27311.diff (text/plain), 1.73 KB, created by
Andrew John Hughes
on 2006-05-07 19:39:31 UTC
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Andrew John Hughes
Created:
2006-05-07 19:39:31 UTC
Size:
1.73 KB
patch
obsolete
>Index: gnu/java/text/StringFormatBuffer.java >=================================================================== >RCS file: /cvsroot/classpath/classpath/gnu/java/text/StringFormatBuffer.java,v >retrieving revision 1.2 >diff -u -3 -p -u -r1.2 StringFormatBuffer.java >--- gnu/java/text/StringFormatBuffer.java 2 Jul 2005 20:32:15 -0000 1.2 >+++ gnu/java/text/StringFormatBuffer.java 7 May 2006 19:29:43 -0000 >@@ -118,4 +118,10 @@ public class StringFormatBuffer implemen > { > return buffer; > } >+ >+ public String toString() >+ { >+ return buffer.toString(); >+ } >+ > } >Index: java/text/DecimalFormat.java >=================================================================== >RCS file: /cvsroot/classpath/classpath/java/text/DecimalFormat.java,v >retrieving revision 1.25 >diff -u -3 -p -u -r1.25 DecimalFormat.java >--- java/text/DecimalFormat.java 7 Dec 2005 15:12:21 -0000 1.25 >+++ java/text/DecimalFormat.java 7 May 2006 19:29:44 -0000 >@@ -542,9 +542,9 @@ public class DecimalFormat extends Numbe > // Compute exponent. > long exponent = 0; > double baseNumber; >- if (useExponentialNotation) >+ if (useExponentialNotation && number > 0) > { >- exponent = (long) Math.floor (Math.log(number) / Math.log(10)); >+ exponent = (long) Math.floor (Math.log10(number)); > exponent = exponent - (exponent % exponentRound); > if (minimumIntegerDigits > 0) > exponent -= minimumIntegerDigits - 1; >@@ -654,7 +654,7 @@ public class DecimalFormat extends Numbe > index = dest.length(); > dest.setDefaultAttribute(NumberFormat.Field.EXPONENT); > String exponentString = Long.toString ((long) exponent); >- >+ > for (count = 0; count < minExponentDigits-exponentString.length(); > count++) > dest.append((char) symbols.getZeroDigit());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 27311
:
11340
| 11397