intmin

Smallest value of an integer class.

Category: Language Fundamentals > Data Types

Syntax

m = intmin

Returns the smallest int32.

m = intmin(classname)

Returns the smallest value of the named integer class.

Description

For signed types the smallest value is -2^(n-1), one unit further from zero than the largest is. For unsigned types it is 0. Subtracting past this value saturates instead of wrapping.

Input arguments

classname
An integer class name, default 'int32', or an integer array whose class is used.

Output arguments

m
Scalar of the requested class.

Example

Limits of integer classes

intmin
intmin('int8')
intmin('uint8')
intmin('int8') - 1
Output
ans = int32
   -2147483648
ans = int8
   -128
ans = uint8
   0
ans = int8
   -128

See also

intmax realmin int8 uint8 flintmax