intmin - Smallest value of specific integer type - MATLAB (original) (raw)

Main Content

Smallest value of specific integer type

Syntax

Description

[v](#mw%5Fec402062-f25f-49cf-9445-ce8fbf2eb908) = intmin returns the smallest value of the 32-bit signed integer type.

example

[v](#mw%5Fec402062-f25f-49cf-9445-ce8fbf2eb908) = intmin([type](#mw%5F927a07f1-2258-4a52-af8c-648d28d90120)) returns the smallest value of the specified integer type. When you convert a value that is smaller than intmin(type) into the integer type type, the value becomes intmin(type).

example

[v](#mw%5Fec402062-f25f-49cf-9445-ce8fbf2eb908) = intmin(like=[p](#mw%5F0fa3e079-6d47-4bb1-b99a-a660d8e0c73f)) returns the smallest value of the integer type with the same data type and complexity (real or complex) as the integer variable p.

example

Examples

collapse all

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

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

Check the class of v.

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

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

The converted value becomes –128.

Check that v1 is the same as v.

Create a 2-by-3 complex array of 8-bit signed integers.

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 as p.

Input Arguments

collapse all

Integer type, specified as a character vector or string. This table shows the valid options for type.

Integer Type Description
"int8" 8-bit signed integer
"int16" 16-bit signed integer
"int32" 32-bit signed integer
"int64" 64-bit signed integer
"uint8" 8-bit unsigned integer
"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

Output Arguments

collapse all

Smallest value of the specified integer type, returned as a scalar.

Extended Capabilities

expand all

This function supports tall arrays with the limitations:

For more information, see Tall Arrays.

The intmin function supports GPU array input with these usage notes and limitations:

For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).

Usage notes and limitations:

For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).

Version History

Introduced before R2006a