TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C++ Coding Standard
Search

Rule:  POR#034Checked automatically with code checker

This rule is Obsolete
Synopsis:Avoid using shift operations instead of arithmetic operations
Language:C++
Severity Level:9
Category:Portability


Description:

It depends on the compiler and platform (e.g. integer memory representation) whether the result of shift operations are the same as the comparable arithmetic operations.

nCount <<= 1;	// Multiplied by 2 or not?
nCount *= 2;	// Preferred.


Literature References:
Ellemtel P. Rec. 17