Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • The right shift is an arithmetic shift, while in C\C++ it is implementation defined (logical or arithmetic).
  • The types boolean, float and double cannot use the bit shifting operators.
  • In C\C++ if the value being left shifted is negative or the right-hand operator of the shift operation is negative or greater than or equal to the width of the promoted left operand, we have undefined behavior. This does not extend to Java as integer types are masked by the last 5 lower order bits of the right operand (or 0x1F). This results in a value modulo 31, inclusive.

...