[kaffe] Simple program shows strange results

Ito Kazumitsu ito.kazumitsu@hitachi-cable.co.jp
Wed Mar 5 15:41:01 2003


In message "Re: [kaffe] Simple program shows strange results"
    on 03/03/06, Ito Kazumitsu <kaz@maczuka.gcd.org> writes:

> >>>>> ":" == Dalibor Topic <robilad@yahoo.com> writes:
> 
> :> Does the problem occurs when the test is compiled with
> :> jikes or Sun's javac, too?
> 
> Yes, I tried with the class file generated by Sun's javac
> and also by GCJ.

These are the results:

[ito@pub2 ito]$ cat Test.java
public class Test {
  public static void main(String[] args) {
      float x = 10.0f;
      if (x < 7.0f) {
        System.err.println("x<7: " + x);
        x = 7.0f;
      }
      System.err.println(x);
  }
}
[ito@pub2 ito]$ ll Test.class*
-rw-rw-r--   1 ito      ito           670 Mar  6 08:31 Test.class.Sun-javac
-rw-rw-r--   1 ito      ito           599 Mar  6 08:33 Test.class.gcj
-rw-rw-r--   1 ito      ito           723 Mar  6 08:37 Test.class.kjc
[ito@pub2 ito]$ for i in kjc gcj Sun-javac; do ln -s -f Test.class.$i Test.class
; java Test; done
4.7761093E-34
4.7761093E-34
4.7761203E-34
[ito@pub2 ito]$