float_1.java

来自「Mac OS X 10.4.9 for x86 Source Code gcc」· Java 代码 · 共 53 行

JAVA
53
字号
/* Date: 25 Aug 1998 16:04:00 -0000From: Andrew Haley <aph@pasanda.cygnus.co.uk>To: java-project@cygnus.comSubject: 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 out40000000with Sun's interpreter, but prints outtruewhen compiled with gcj; PrintStream dispatches a string arg as aboolean 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");    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?