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

Javadoc of floorDiv() and floorMod() families is inaccurate in some places

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b10
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      A DESCRIPTION OF THE PROBLEM :
      Errata in floorDiv(int, int), floorDiv(long, int) and floorDiv(long, long)
      ----
      "The floor rounding mode gives different results from truncation when the exact result is negative."
      shall be replaced with:
      "The floor rounding mode gives different results from truncation when the exact result is [[not integer and]] negative."


      Errata in floorDiv(int, int)
      ----
      "If the signs of the arguments are the same, the results..."
      shall be replaced with:
      "If the signs of the arguments are the same [[or x is zero]], the results..."

      Errata in floorDiv(int, int)
      ----
      "If the signs of the arguments are different, the quotient is negative and floorDiv returns the integer less than or equal to ..."
      shall be replaced with:
      "If the signs of the arguments are different [[and x is not zero]], the quotient is negative and floorDiv returns the [[largest]] integer less than or equal to ..."



      Errata in floorMod(int, int), floorMod(long, int) and floorMod(long, long)
      ----
      "The floor modulus is x - (floorDiv(x, y) * y), has the same sign as the divisor y, and..."
      shall be replaced with:
      "The floor modulus is [[r =]] x - (floorDiv(x, y) * y), has the same sign as the divisor y [[or is zero]], and..."

      Errata in floorMod(int, int)
      ----
      "that returns the integer less than or equal to..."
      shall be replaced with:
      "that returns the [[largest]] integer less than or equal to..."

      Errata in floorMod(int, int)
      ----
      "If the signs of the arguments are the same, the results..."
      shall be replaced with:
      "If the signs of the arguments are the same [[or x is zero]], the results..."

      Errata in floorMod(int, int)
      ----
      "If the signs of the arguments are different, the results..."
      shall be replaced with:
      "If the signs of the arguments are different [[and x is not zero]], the results..."

      Errata in floorMod(int, int)
      ----
      "If the signs of arguments are unknown..."
      shall be removed, as it might lead to erroneous results due to overflow in the sum.





      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bpb Brian Burkhalter
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: