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

JLS3 15.19 Explanation of left shift operator is wrong

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b97
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      A DESCRIPTION OF THE PROBLEM :
      The Java Language Specification found at the following link is wrong:

      http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.19

      It contains an explanation on shift operators, saying that n>>s whould be the same as n/s. This is wrong. Actually it has to read that n>>s is n/(2^s).

      I wonder why nobody noticed that before.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Read the documentation and think about it.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      See above.
      ACTUAL -
      See above.

      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Activity

            People

            Assignee:
            iris Iris Clark
            Reporter:
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: