|
Last change
on this file since 3127 was 2, checked in by bird, 23 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
991 bytes
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 |
|
|---|
| 3 | Date: 25 Aug 1998 16:04:00 -0000
|
|---|
| 4 | From: Andrew Haley <[email protected]>
|
|---|
| 5 | To: [email protected]
|
|---|
| 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 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.