October 2004
Beginner
408 pages
9h 24m
English
Another source of potential conflict can arise when the value of a variable becomes too large or too small for its type for the computer running the application. When this occurs, it's called overflow and underflow. Depending on the computer, this will either cause an error or return alternative results.
This happens most frequently with floats, and it will obviously mess up any calculations made with such a value. When you attempt to print this variable, you'll most likely see either inf or infinity, indicating that the value is out of range.
The best way to avoid these problems is by knowing the limits for a particular type. This information is stored in the limits.h (for integers and characters) and float.h ...
Read now
Unlock full access