intmin
Smallest value of specific integer type
Description
v = intmin
returns the smallest value of the 32-bit signed integer type.
v = intmin(
returns the smallest value of the specified integer type. When you convert a value that is smaller thantype
)intmin(type)
into the integer typetype
, the value becomesintmin(type)
.
Examples
Smallest Value of 32-bit Signed Integer
Return the smallest value of the 32-bit signed integer type.
v = intmin
v =int32-2147483648
Smallest Value of 64-bit Unsigned Integer
Return the smallest value of the 64-bit unsigned integer type.
v = intmin("uint64")
v =uint640
Check the class ofv
.
class(v)
ans = 'uint64'
Convert Value Smaller Thanintmin
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 thatv1
is 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
type
—整数类型
“ int32”
(default) |character vector|string
整数类型, specified as a character vector or string. This table shows the valid options fortype
.
整数类型 | Description |
---|---|
|
8-bit signed integer |
|
16-bit signed integer |
|
32-bit signed integer |
|
64位签名整数 |
|
8位未签名的整数 |
|
16-bit unsigned integer |
|
32-bit unsigned integer |
|
64-bit unsigned integer |
p
—Prototype
整数变量
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:
The supported syntax is
intmin("like",p)
, where the underlying data type ofp
must be an integer type.
For more information, seeTall 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, seeRun MATLAB Functions in Thread-Based Environment.
GPU Arrays
使用并行计算工具箱™在图形处理单元(GPU)上运行加速代码。
Usage notes and limitations:
The supported syntax is
intmin("like",p)
, where the underlying data type ofp
must be an integer type.
For more information, seeRun 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:
The supported syntax is
intmin("like",p)
, where the underlying data type ofp
must be an integer type.
For more information, see运行具有分布式数组的MATLAB功能(Parallel Computing Toolbox).
版本sion History
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- AméricaLatina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- 丹麦(English)
- Deutschland(Deutsch)
- España(Español)
- Finland(English)
- 法国(Français)
- 爱尔兰(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- 挪威(English)
- Österreich(Deutsch)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)