Question the relevance of exercises 37 and 38
These two exercises are optional, and question whether the code answers properly when stress is applied over its types.
However, I discovered that the provided solutions were far from complete, and I even realize that the premise of the first exercise is flawed:
- Exercise 38 tests whether the program works for
char
types. The goal was originally to provide creative solutions to force thechar
to be displayed as an integer and not gibberishy characters.
However,
0.65 * 3515 + 0.35 * 4832
is senseless when we realize that both 3515
and 4832
are out of the range of char
...
- Exercise 39 is trickier: it was a work around to deal properly with negative values.
I like the fact we don't hide under the carpet the fact our code is not so robust, but once again the solution was flawed and assumed only signed types were used.
I provide in branch 'sebastien/2024_sebastien_reread_part5' (soon to be proposed in a MR) a working solution for it, but it relies on stuff we haven't presented previously (And some we do not present at all)
As it is optional we may let it nonetheless and indicate it is a hard one in the notebook, or we could remove it entirely.