Skip to content

Files

Latest commit

 

History

History
11 lines (6 loc) · 453 Bytes

truncLongCastAssignment.md

File metadata and controls

11 lines (6 loc) · 453 Bytes

Pattern: int result is assigned to long variable

Issue: -

Description

int result is assigned to long variable. If the variable is long to avoid loss of information, then there is loss of information. To avoid loss of information you must cast a calculation operand to long, for example l = a * b; => l = (long)a * b;.

Further Reading