Summary

All right, this is enough on C++ types and expression evaluation. As you see, it is always a good idea to think about the ranges of types you are using. This is important both from the point of view of portability and from the point of view of correctness of the results. Unless you have specific reasons to do otherwise (like your boss tells you to), use types int and double, but make sure that they work correctly for you.

We covered a lot of ground in this chapter, and it might take some time for the material to settle down. Experiment with the examples, and rely on the material covered in Chapter 2 as the foundation of your work in C++. Do not use advanced features too much, too soon.

Mix numeric types in expressions freely as you see ...

Get Core C++ A Software Engineering Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.