Bug#350729: cacao: Incorrect result due to computations in extended precision on x86 (regression)

Vincent Lefevre vincent at vinc17.org
Tue Jan 31 12:54:11 UTC 2006


Package: cacao
Version: 0.94-1
Severity: normal

With the following program:

public class test {
    public static void main(String[] args) throws Exception {
        test t = new test();
        t.doTest();
    }

    volatile double x, y, z, d;

    public void doTest() {
        x = 9007199254740994.0; /* 2^53 + 2 */
        y = 1.0 - 1/65536.0;
        z = x + y;
        d = z - x;
        System.out.println("z = " + z);
        System.out.println("d = " + d);
    }
}

I get on an x86 machine:

z = 9.007199254740996E15
d = 2.0

According to the Java specifications, computations must correspond
to the IEEE-754 double precision, and the result is incorrect.

Package cacao 0.93-4 did not have this problem:

z = 9.007199254740994E15
d = 0.0

For more information about this problem under Linux/x86 and various JVMs:

  http://www.vinc17.org/research/extended.html

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14.4-20051215
Locale: LANG=POSIX, LC_CTYPE=en_US.ISO8859-1 (charmap=ISO-8859-1)

Versions of packages cacao depends on:
ii  binutils             2.16.1cvs20060117-1 The GNU assembler, linker and bina
ii  classpath            2:0.20-2            clean room standard Java libraries
ii  classpath-common     2:0.20-2            architecture independent files
ii  libc6                2.3.5-12            GNU C Library: Shared libraries an
ii  libltdl3             1.5.22-2            A system independent dlopen wrappe
ii  zlib1g               1:1.2.3-9           compression library - runtime

cacao recommends no packages.

-- no debconf information




More information about the pkg-java-maintainers mailing list