Main Content

intmin

Smallest value of specified integer type

Syntax

v = intmin
v = intmin('classname')

Description

v = intminis the smallest value that can be represented in the MATLAB®software with a 32-bit integer. Any value smaller than the value returned byintminsaturates to theintminvalue when cast to a 32-bit integer.

v = intmin('classname')is the smallest positive value in the integer classclassname. Valid values for the stringclassnameare

'int8'

'int16'

'int32'

'int64'

“uint8”

'uint16'

'uint32'

'uint64'

intmin('int32')is the same asintminwith no arguments.

Examples

Find the minimum value for a 64-bit signed integer:

v = intmin('int64') v = -9223372036854775808

Convert this value to a 32-bit signed integer:

x = int32(v) x = -2147483648

Compare the result with the default value returned byintmin:

isequal(x, intmin) ans = 1

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced before R2006a