[kaffe] Re: Bug#255502: kaffe: Incorrect result due to computations in extended precision on x86

Arnaud Vandyck avdyk at debian.org
Mon Jun 21 08:52:02 PDT 2004


tags 255502 + upstream
forwarded 255502 kaffe at kaffe.org
thanks

Many thanks for your test case and for filing this bug!

I'm sure the kaffe team will be happy with this report (I mean it'll be
easier to fix with your test case ;-))

And many thanks to run kaffe!

Cheers,

Vincent Lefevre <vincent at vinc17.org> writes:

> Concerning the following Java source:
>
> ------------------------------------------------------------------
> // $Id: test.java 3730 2004-06-21 13:02:51Z lefevre $
>
> public class test {
>     public static void main(String[] args) throws Exception {
>         test t = new test();
>         t.doTest();
>     }
>
>     volatile double x, y, z;
>
>     public void doTest() {
>         x = 9007199254740994.0; /* 2^53 + 2 */
>         y = 1.0 - 1/65536.0;
>         z = x + y;
>         System.out.println("z = " + z);
>     }
> }
> ------------------------------------------------------------------
>
> I've compiled it with "gcj -C test.java" (GCC 3.3.4).
>
> Sun's JVM gives the correct result:
>
> greux:~/wd/src/fp> /usr/local/j2re1.4.1/bin/java test
> z = 9.007199254740994E15
>
> but not kaffe:
>
> greux:~/wd/src/fp> kaffe test
> z = 9.007199254740996E15
>
> kaffe should switch the FPU of the x86 processor (Pentium III in
> my case) to rounding in double precision to avoid the effect of
> the "double rounding" (you may find some information about this
> effect here: <http://www.srware.com/linux_numerics.txt>).

-- 
Arnaud Vandyck

I'm personally quite happy with one stable release every two years, and
am of the opinion that trying to release more will mean we'll have to
rename the distro from "stable" to "wobbly".
		-- Scott James Remnant on debian-devel




More information about the kaffe mailing list