OSDN Git Service

2004-07-14 Bryce McKinlay <mckinlay@redhat.com>
[pf3gnuchains/gcc-fork.git] / libjava / testsuite / libjava.lang / Float_1.java
1 /* 
2
3 Date: 25 Aug 1998 16:04:00 -0000
4 From: Andrew Haley <aph@pasanda.cygnus.co.uk>
5 To: java-project@cygnus.com
6 Subject: Help: vtable problem?
7
8 My little program:
9
10 -----------------------------------------------------------------------
11 import java.lang.*;
12
13   public class widget
14   {
15     public static void main (String argv[])
16     {
17       int test = Float.floatToIntBits((float)2.0);
18       String s = Integer.toHexString(test);
19       
20       System.out.print (s+"\n");
21     }
22
23   }
24 -----------------------------------------------------------------------
25 prints out
26
27 40000000
28
29 with Sun's interpreter, but prints out
30
31 true
32
33 when compiled with gcj; PrintStream dispatches a string arg as a
34 boolean rather than as a String.  I've tried to rebuild everything.
35
36 ?
37
38 Thanks,
39 Andrew.
40
41 */
42
43 public class Float_1
44 {
45   public static void main (String argv[])
46     {
47       int test = Float.floatToIntBits((float)2.0);
48       String s = Integer.toHexString(test);
49       
50       System.out.print (s+"\n");
51     }
52 }