Versions Compared

Key

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

...

Although clearly defined in the Java specification, the behavior is undefined in several early C implementations and it is represented by the same symbol as the modulus operator, which always returns a positive value. Therefore, it is possible to have unintended behavior from use of this operator. Programmers who are unaware of this distinction might always expect a positive remainder and code accordingly. This can result in vulnerabilities.

The result of the remainder operator implies the following behavior:

...