intmax - Largest value of specific integer type - MATLAB (original) (raw)

Largest value of specific integer type

Syntax

Description

v = intmax returns the largest value of the 32-bit signed integer type.

example

v = intmax([type](#mw%5F73a4b0c3-bbd2-4e4a-9553-27d209228077)) returns the largest value of the specified integer type. When you convert a value that is larger thanintmax(type) into the integer type type, the value becomes intmax(type).

example

v = intmax("like",[p](#mw%5F445778e0-3114-4d9a-a399-f1fa7be1c074)) returns the largest value of the integer type with the same data type and complexity (real or complex) as the integer variable p.

example

Examples

collapse all

Largest Value of 32-Bit Signed Integer

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

Largest Value of 64-Bit Unsigned Integer

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

v = uint64

18446744073709551615

Check the class of v.

Convert Value Larger Than intmax

Return the largest value of the 8-bit signed integer type, which is 127.

Convert a value larger than 127 to 8-bit signed integer.

The converted value becomes 127.

Check that v1 is the same as v.

Specify Data Type and Complexity from Existing Array

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

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

Return the largest value of the integer type with the same data type and complexity as p.

Input Arguments

collapse all

type — Integer type

"int32" (default) | character vector | string

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

p — Prototype

integer variable

Prototype, specified as an integer variable.

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

Extended Capabilities

Tall Arrays

Calculate with arrays that have more rows than fit in memory.

This function supports tall arrays with the limitations:

For more information, see Tall Arrays.

C/C++ Code Generation

Generate C and C++ code using MATLAB® Coder™.

Thread-Based Environment

Run code in the background using MATLAB® backgroundPool or accelerate code with Parallel Computing Toolbox™ ThreadPool.

This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.

GPU Arrays

Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.

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

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

Distributed Arrays

Partition large arrays across the combined memory of your cluster using 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