The results of integer arithmetic can easily overflow the data type allotted for
storage. For example, the maximum value you can store in
is 255. Arithmetic operations can also result in fractional values, which cannot be
represented using integer arrays.
MATLAB® arithmetic operators and the Image Processing Toolbox™ arithmetic functions use these rules for integer arithmetic:
Values that exceed the range of the integer type are clipped, or truncated, to that range.
Fractional values are rounded.
For example, if the data type is
uint8, results greater than 255
Inf) are set to 255. The table lists some additional