Versions Compared

Key

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

...

Failing to consider integer promotions when dealing with floating-point and integer operands can result in loss of precision.

Automated Detection

ToolVersionCheckerDescription
SonarQube Java Plugin
Include Page
SonarQube Java Plugin_V
SonarQube Java Plugin_V
S3034 

 

Bibliography

[Bloch 2005]

Puzzle 9, "Tweedledum"
Puzzle 31, "Ghost of Looper"

[Findbugs 2008]

"BIT: Bitwise OR of Signed Byte Value"

[JLS 2013]

§4.2.2, "Integer Operations"
§5.6, "Numeric Promotions"
§15.26.2, "Compound Assignment Operators"

...