aboutsummaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.lang/Float_1.java
blob: cb147ee8aca9ddd0ba710eef1a8e8f1e83c3075a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* 

Date: 25 Aug 1998 16:04:00 -0000
From: Andrew Haley <aph@pasanda.cygnus.co.uk>
To: java-project@cygnus.com
Subject: Help: vtable problem?

My little program:

-----------------------------------------------------------------------
import java.lang.*;

  public class widget
  {
    public static void main (String argv[])
    {
      int test = Float.floatToIntBits((float)2.0);
      String s = Integer.toHexString(test);
      
      System.out.print (s+"\n");
    }

  }
-----------------------------------------------------------------------
prints out

40000000

with Sun's interpreter, but prints out

true

when compiled with gcj; PrintStream dispatches a string arg as a
boolean rather than as a String.  I've tried to rebuild everything.

?

Thanks,
Andrew.

*/

public class Float_1
{
  public static void main (String argv[])
    {
      int test = Float.floatToIntBits((float)2.0);
      String s = Integer.toHexString(test);
      
      System.out.print (s+"\n");
    }
}