Overflow & Underflow
Every type of numeric variable has a range of minimum and maximum value. Any value between the given ranges of values can be assigned to it. An error occurs, when a value that exceeds the limits is assigned to a variable.An overflow occurs when the value assigned to the variable is more than the maximum possible value. For example, the maximum value for 'int' type variable is 32767. If the assigned value is more than 32767, then an integer overflow occurs.
Similarly, an underflow occurs when the value assigned to the variable is less than the minimum possible value. For example, the minimum value for 'int' type variable is -32768. If the assigned value is less than -32768, then an integer underflow occurs.
The overflow and underflow are not detected by compiler. So program may produce incorrect output result.
No comments:
Post a Comment
Thanks For Visiting Here...!! I will Reply you as soon as possible.