Mathematics Previous page   Next Page

Largest and Smallest Values for Integer Data Types

For each integer data type, there is a largest and smallest integer that you can represent with that data type. The table in Integer Data Types lists the largest and smallest values for each integer data type in the "Range of Values" column. You can also return these values with the intmax and intmin commands. For example,

If you convert a number that is larger than the maximum value of an integer data type to that data type, MATLAB returns the maximum value. This is called saturating on overflow.

Similarly, if you convert a number that is smaller than the minimum value of the integer data type, MATLAB returns the minimum value.

You can make MATLAB return a warning when your input is outside the range an integer data type. Warnings for Integer Data Types explains how to turn these warnings on.


Previous page  Integer Data Types Integer Arithmetic Next page

© 1994-2005 The MathWorks, Inc.