June 2004
Intermediate to advanced
848 pages
21h 28m
English
When a result is too big for the type intended to hold it because of a cast, an implicit type conversion, or the evaluation of an expression, something has to give! What happens depends on whether the result type is integer or floating point.
When an integer-valued expression is too big for its type, only the low end (least significant) bits get stored. Because of the way two's-complement numbers are stored, adding one to the highest positive integer value gives a result of the highest negative integer value. Watch out for this (it's true for all languages that use standard arithmetic, not ...
Read now
Unlock full access