Main Content

intmin

Smallest value of specific integer type

Description

example

v = intminreturns the smallest value of the 32-bit signed integer type.

example

v = intmin(type)returns the smallest value of the specified integer type. When you convert a value that is smaller thanintmin(type)into the integer typetype, the value becomesintmin(type).

example

v = intmin("like",p)returns the smallest value of the integer type with the same data type and complexity (real or complex) as the integer variablep.

Examples

collapse all

Return the smallest value of the 32-bit signed integer type.

v = intmin
v =int32-2147483648

Return the smallest value of the 64-bit unsigned integer type.

v = intmin("uint64")
v =uint640

Check the class ofv.

class(v)
ans = 'uint64'

Return the smallest value of the 8-bit signed integer type, which is –128.

v = intmin("int8")
v =int8-128

Convert a value smaller than –128 to 8-bit signed integer.

v1 =int8(-135)
v1 =int8-128

The converted value becomes –128.

Check thatv1is the same asv.

isequal(v,v1)
ans =logical1

创建一个由8位签名整数组成的2 x-3复合阵列。

p = int8([-12 3+2i 2; 6 3 2-7i]);

Return the smallest value of the integer type with the same data type and complexity asp.

v = intmin("like",p)
v =int8-128 + 0i
class(v)
ans = 'int8'

Input Arguments

collapse all

整数类型, specified as a character vector or string. This table shows the valid options fortype.

整数类型 Description

"int8"

8-bit signed integer

"int16"

16-bit signed integer

“ int32”

32-bit signed integer

"int64"

64位签名整数

"uint8"

8位未签名的整数

"uint16"

16-bit unsigned integer

"uint32"

32-bit unsigned integer

"uint64"

64-bit unsigned integer

Prototype, specified as an integer variable.

Data Types:int8|int16|int32|int64|uint8|uint16|uint32|uint64
Complex Number Support:Yes

Extended Capabilities

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

版本sion History

Introduced before R2006a