[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/23996] New: DecimalFormat.format() is givng different val
From: |
subramanian dot vaitheeswaran at applabs dot com |
Subject: |
[Bug classpath/23996] New: DecimalFormat.format() is givng different values in Java and DOTNet. |
Date: |
21 Sep 2005 12:21:51 -0000 |
Description : When the testcase source code is being ikvm'd [C:\>ikvmc -
target:library -reference:IKVM.GNU.Classpath.dll DecimalFormatter.jar]. We
get different output.
TestCase Source code :
#package DecimalFormatter;
#
#import java.text.DecimalFormat;
#
#
#public class TestFormatter
#{
#
# public TestFormatter()
# {
# System.out.println("Started DecimalFormat Testcase ....");
#
# float flt = 1234577777;
# String strFlt = new DecimalFormat("S#.12345").format
(Float.MAX_VALUE);
# String strFlt1 = new DecimalFormat("S#.00").format
(Float.MAX_VALUE);
# String strFlt2 = new DecimalFormat("0.7547895").format
(Float.MAX_VALUE);
#
# System.out.println("Float.MAX_VALUE is " + Float.MAX_VALUE);
# System.out.println("Float.MIN_VALUE is " + Float.MIN_VALUE);
# System.out.println("Formatted value for "+Float.MAX_VALUE+" in
Format S#.12345 is " + strFlt);
# System.out.println("Formatted value for "+Float.MAX_VALUE +"
in Format S#.00 is " + strFlt1);
# System.out.println("Formatted value for "+Float.MAX_VALUE +"
in Format 0.7547895 is " + strFlt2);
#
#
# System.out.println("End....");
# }
# public static void main(String[] args)
# {
# TestFormatter objTestFormatter = new TestFormatter();
# }
#}
#
Output :
*** In JAVA ***
Started DecimalFormat Testcase ....
Float.MAX_VALUE is 3.4028235E38
Float.MIN_VALUE is 1.4E-45
Formatted value for 3.4028235E38 in Format S#.12345 is
S340282346638528860000000000000000000000.12345
Formatted value for 3.4028235E38 in Format S#.00 is
S340282346638528860000000000000000000000.00
Formatted value for 3.4028235E38 in Format 0.7547895 is
340282346638528860000000000000000000000.7547895
End....
*** In .NET
Started DecimalFormat Testcase ....
Float.MAX_VALUE is 3.4028235E38
Float.MIN_VALUE is 1.4E-45
Formatted value for 3.4028235E38 in Format S#.12345 is
S922337203685477580712345
Formatted value for 3.4028235E38 in Format S#.00 is S9223372036854775807.00
Formatted value for 3.4028235E38 in Format 0.7547895 is
922337203685477580775478
95
End....
--
Summary: DecimalFormat.format() is givng different values in Java
and DOTNet.
Product: classpath
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: classpath
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: subramanian dot vaitheeswaran at applabs dot com
CC: bug-classpath at gnu dot org,subramanian dot
vaitheeswaran at applabs dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23996
- [Bug classpath/23996] New: DecimalFormat.format() is givng different values in Java and DOTNet.,
subramanian dot vaitheeswaran at applabs dot com <=