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

integer remainder operation throws an exception in Windows

XMLWordPrintable

    • sparc
    • solaris_2.4



      Name: swC45995 Date: 10/07/96


      In Windows integer remainder operation completes abruptly in the case when
      the negative value of the largest magnitude is the dividend and -1 is the
      divisor. Thus, execution of the following test:

      public class test
      {
      public static void main(String argv[])
      {
      int i = 0x80000000;

      System.out.println(i % -1);
      }
      }

      produces the following output:

      exception of rounding to zero:

      instead of expected:

      0

      ======================================================================

            egilbertsunw Eric Gilbertson (Inactive)
            wensunw Wen Wen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: