ASF Bugzilla – Attachment 28850 Details for
Bug 43940
[PATCH] Faster method for double formatting
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for both class and test case (DoubleFormatUtil.java and DoubleFormatUtilTest.java)
DoubleFormatUtil-patch.txt (text/plain), 1.47 KB, created by
Julien Aymé
on 2012-05-29 08:40:27 UTC
(
hide
)
Description:
patch for both class and test case (DoubleFormatUtil.java and DoubleFormatUtilTest.java)
Filename:
MIME Type:
Creator:
Julien Aymé
Created:
2012-05-29 08:40:27 UTC
Size:
1.47 KB
patch
obsolete
>Index: src/java/org/apache/xmlgraphics/util/DoubleFormatUtil.java >=================================================================== >--- src/java/org/apache/xmlgraphics/util/DoubleFormatUtil.java (revision 1343596) >+++ src/java/org/apache/xmlgraphics/util/DoubleFormatUtil.java (working copy) >@@ -92,7 +92,7 @@ > // The only way to format precisely the double is to use the String > // representation of the double, and then to do mathematical integer operation on it. > String s = Double.toString(source); >- if (source >= 10e-3 && source < 1e7) { >+ if (source >= 1e-3 && source < 1e7) { > // Plain representation of double: "intPart.decimalPart" > int dot = s.indexOf('.'); > String decS = s.substring(dot + 1); >Index: test/java/org/apache/xmlgraphics/util/DoubleFormatUtilTest.java >=================================================================== >--- test/java/org/apache/xmlgraphics/util/DoubleFormatUtilTest.java (revision 1343596) >+++ test/java/org/apache/xmlgraphics/util/DoubleFormatUtilTest.java (working copy) >@@ -118,6 +118,12 @@ > expected = "0.00002"; > actual = format(value, decimals, precision); > assertEquals(value, decimals, precision, expected, actual); >+ >+ // Test added after bug #43940 was reopened >+ value = 0.005859375; >+ expected = "0.00585938"; >+ actual = format(value, 8, 8); >+ assertEquals(value, 8, 8, expected, actual); > } > > /**
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 43940
:
25508
|
25509
|
25585
|
25586
|
28686
|
28846
|
28850
|
28855