intmin

tmin 'in tmin
基础资料
简介

正文

Matlab中intmin简介

函数功能:返回指定整数类型所能表示的最小值。

调用格式:

v = intmin

返回matlab中32位正整数所能表示的最小值。

v = intmin('ClassName')

返回指定的整数类型所能表示的最小值。'classname'可以是:

'int8'、'int16'、'int32'、'int64'、'uint8'、'uint16'、'uint32'、'uint64'。

相关函数: intmax

程序示例

close all; clear; clc;

type_cell{1} = 'int';

type_cell{2} = 'uint';

bits = [8, 16, 32, 64];

for m = 1:2

for k = 1:4

type_str = strcat(type_cell{m}, num2str(bits(k)));

fprintf('The smallest number ''%s'' can represent is %s\n', ...

type_str, num2str(intmin(type_str)));

end

end

运行结果

The smallest number 'int8' can represent is -128

The smallest number 'int16' can represent is -32768

The smallest number 'int32' can represent is -2147483648

The smallest number 'int64' can represent is -9223372036854775800

The smallest number 'uint8' can represent is 0

The smallest number 'uint16' can represent is 0

The smallest number 'uint32' can represent is 0

The smallest number 'uint64' can represent is 0

上面这个程序打印出了matlab中各种整数类型所能表示的最小整数。

首页
科技
#贵族
最新入驻
贾科莫·普契尼
Caroline Lufkin
翁建宇
相关阅读
DataGridView
内容词条·3266人浏览
动卧车
内容词条·5235人浏览
AddNew
内容词条·4043人浏览
cd
内容词条·5887人浏览
RowHeight
内容词条·2336人浏览
HLDS
内容词条·3602人浏览
  • 网站地图
  • |

Copyright 2023 fuwu029.com赣ICP备2022008914号-4