The Usual Arithmetic Confusions--Shafik Yaghmour

Do you know the conversions?

The Usual Arithmetic Confusions

by Shafik Yaghmour

From the article:

There are a lot of aspects of C++ that are not well understood and lead to all sorts of confusion. The usual arithmetic conversions and the integral promotions are two such aspects. Certain binary operators (arithmetic, relational and spaceship) require their operands to have a common type. The usual arithmetic conversions are the set of steps that gets operands to a common type. While the integral promotions brings integral types smaller than int and unsigned int to either int or unsigned int depending on which one can represent all the values of the source type. This is one of the areas in C++ that comes directly from C, so pretty much all of these examples applies to C as well as C++...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.