What is Underflow and overflow??
15 views (last 30 days)
Show older comments
Like the title said what is underflow and overflow? if 1000^-500 is this underflow? what about -1000^500?? underflow too??
0 Comments
Answers (1)
Walter Roberson
on 13 Jun 2015
http://www.mathworks.com/help/matlab/matlab_prog/floating-point-numbers.html and scan down to "Largest and smallest"
8 Comments
Walter Roberson
on 13 Jun 2015
The conventions about what "underflow" and "overflow" mean are different between integers and floating point numbers.
For floating point numbers, "underflow" is said to occur when a value is too close to 0 to differentiate it from 0.
For integer class numbers, "underflow" is said to occur when the value would be less than the minimum integer representable in that class.
In every floating point system that I know of, a value that is too close to 0 is made into 0 (though there may be provisions to signal an exception when it happens.)
In the majority of integer representations, a value that is too negative gets converted into a positive value, and a value that is too positive gets converted into a negative value; such systems are said to "wrap around". Those systems are much more common than the way MATLAB does it. An example would be that with 16 bit signed integers, subtracting 1 from -32768 would give you +32767 in those systems, and adding 1 to +32767 would give you -32768.
... Since you asked about underflow and overflow.
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!