Hi all.

I was using the Blackdown port of the JDK version 1.1.7 v1a
on a Debian Linux box when I ran into this bug in the port.
Here is a small piece of code that reproduces the bug and
the output on a Sun Solaris box vs my Linux box. I am also
going to put a bug report in the jitterbug database but
I thought people might like to try this out to see if they
are having the same problem.


public class Zero {
    public static  double zero = -0.0;
    public static  double myarray[] = { -0.0, 0.0, +0.0};
    public String printmyarray() {
        return  "zero=" + zero + " myarray=" + myarray[0] + " " +
                myarray[1] + " " +
                myarray[2];
    }
    public static void main(String argv[]) {
        Zero z1 = new Zero();
        System.out.println(z1.printmyarray());

        Double z2 = new Double("-0.0");
        System.out.println(z2.doubleValue());
        System.out.println(zero);
        System.out.println(z2.equals(new Double(zero)));
    }
}



(On a Sun system with JDK 1.1.6)

% java Zero
zero=-0.0 myarray=-0.0 0.0 0.0
-0.0
-0.0
true

(On a Linux box with JDK 1.1.7 v1a)

% java Zero
zero=-0.0 myarray=-0.0 0.0 0.0
0.0
-0.0
false



So it looks like the problem is in the Double string parsing code.


I hope that helps
Mo DeJong
dejong at cs.umn.edu


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to