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

different simple math results with and w/o JIT

XMLWordPrintable

    • 1.1.6
    • x86
    • windows_95, windows_nt
    • Verified



        Name: tb29552 Date: 05/16/98


        Using the class below, execute it with the jit
        and without. This is the result...

        >java TestLargeNegLong
        -1729256767
        >java -nojit TestLargeNegLong
        1


        public class TestLargeNegLong {

          public static void main(String[] arg) {
            long l = 0xFFFFFFFFFFFFFFFFL;
            long out = test(l);
            System.out.println(out);
          }

          static long test(long s) {
            long sRaised = s;
            long n = 1799233297L;
            long prod = 1;

            for (int i = 0; i < 3; i++) {
              if (i == 1 || i == 2)
                 prod = (prod * sRaised) % n;
              sRaised = (sRaised * sRaised) % n;
            }
            readVal(prod);
            return prod;
          }

          private static void readVal(long l) {
            if (l < 0) l = -l;
          }
        }
        (Review ID: 30014)
        ======================================================================

              dviswanasunw Deepa Viswanathan (Inactive)
              tbell Tim Bell
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: