Skip to content

Commit

Permalink
Missing half of answer 4.7
Browse files Browse the repository at this point in the history
The answer to 4.7 is missing the definition of overflow.
  • Loading branch information
psigillito committed Sep 13, 2015
1 parent 37994e4 commit 2e517f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ch04/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##Exercise 4.1
##Exercise 4.1
>What is the value returned by 5 + 10 * 20/2?
105
Expand Down Expand Up @@ -51,6 +51,9 @@ and printing its result.
##Exercise 4.7
>What does overflow mean? Show three expressions that will overflow.
from the book:
>Some arithmetic expressions yield undefined results. Some of these undefined espressions are due to the nature of mathematics-for example, division by zero. Others are undefined due to the nature of computers-for example, due to overflow. Overflow happens when a value is computed that is outside the range of values that the type can represent.
```cpp
short svalue = 32767; ++svalue; // -32768
unsigned uivalue = 0; --uivalue; // 4294967295
Expand Down

0 comments on commit 2e517f4

Please sign in to comment.