Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4671453

Incorrect long comparison for specific long values

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 1.3.1_03, 1.4.0, 1.4.1
    • Fix Version/s: 1.3.1_05
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      05
    • CPU:
      x86
    • OS:
      windows_nt

      Backports

        Description

        Windows systems are not able to deal with a given long
        which is namely: 9223372034707292160L.
        Several thousand numbers below or above are fine.

        The problem does not occur on Solaris. It seems to occur
        on most 1.3 releases and on 1.4 on Windows.
        The bug has been file against 1.3.1._03 and needs a fix there.

        Please check the simple testcase:

        public class LongCompTest {

          public static void main(String[] args) {
            System.out.println("\n--[2 Longs compare problem]--------------------");
            long l1 = 9223372034707292160L;
            long l2 = -9223372034707292160L;
            System.out.println("MAX_LONG: " + Long.MAX_VALUE );
            System.out.println("MIN_LONG: " + Long.MIN_VALUE );
            System.out.println("l1: " + l1);
            System.out.println("l2: " + l2);
            System.out.println("When comparing l1 with l2 - the result is [" + (l1 == l2
        )+"]...");
          }
        }

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                azeemj Azeem Jiva
                Reporter:
                stschnei Stefan Schneider (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: