当前位置:网站首页>#yyds Dry Goods Inventory#[Yugong Series] August 2022 Go Teaching Course 008-Integer of Data Types
#yyds Dry Goods Inventory#[Yugong Series] August 2022 Go Teaching Course 008-Integer of Data Types
2022-08-11 00:58:00 【51CTO】
I. Summary of data types
There are four data types in the go language: basic types, composite types, reference types, and interface types.
Type | Name | Length | zero value | Description |
---|---|---|---|---|
bool | Boolean | 1 | false | If its value is not true, it is false. You cannot use numbers to represent true or false |
byte | bytes | 1 | 0 | uint8 alias |
rune | Character Type | 4 | 0 | Dedicated to storing unicode encoding, equivalent to uint32 |
int, uint | Integer | 4 or 8 | 0 | Signed 32-bit or Unsigned 64-bit |
int8 | Integer | 1 | 0 | -128~ 127, |
uint8 | Integer | 1 | 0 | 0~255 |
int16 | Integer | 2 | 0 | -32768 ~ 32767, |
uint16 | Integer | 2 | 0 | 0 ~ 65535 |
int32 | Integer | 4 | 0 | -2147483648 to 2147483647 |
uint32 | Integer | 4 | 0 | 0 to 4294967295 (4.2 billion) |
int64 | Integer | 8 | 0 | -9223372036854775808 to 9223372036854775807 |
uint64 | Integer | 8 | 0 | 0 to 18446744073709551615 (1844 Beijing) |
float32 | float | 4 | 0.0 | Accurate to 7 decimal places |
float64 | float | 8 | 0.0 | Accurate to 15 decimal places |
complex64 | plural type | 8 | ||
complex128 | plural type | 16 | 64-bit real and imaginary numbers | |
uintptr | Integer | 4 or 8 | a uint32 or uint64 integer large enough to store a pointer | |
strina | string | "” | utf-8 string |
2. Integer
Integers are divided into the following two categories: signed integers and unsigned integers.
- Signed integer (int): positive integer, negative integer, 0; divided by length: int8, int16, int32, int64
- Unsigned integer (uint): positive integer, 0; divided by length: uint8, uint16, uint32, uint64
Range of integers:
- Signed Integer
- 32-bit system: int is 4 bytes, range: -2147483648 to 2147483647
- 64-bit system: int is 8 bytes, range: -9223372036854775808 to 9223372036854775807
- Unsigned int
- On 32-bit systems: 4 bytes, 0 to 4294967295
- On 64-bit systems: 8 bytes, 0 to 18446744073709551615
bytes
- Bit (bit): The smallest storage unit, the computer stores binary 0, 1, and the bit is used to store binary.
- Byte: The basic storage unit, represented by a capital B, 1 byte=8bit, 1KB=1024B, 1MB=1024KB, 1G=1024MB
边栏推荐
- How to do patent mining, the key is to find patent points, in fact, it is not too difficult
- 关于编程本质那些事
- 【Video】Report Sharing | 2021 Insurance Industry Digital Insights
- 微信小程序强制更新版本
- 使用 BeanUtils 做属性拷贝,性能有点拉胯!
- How to check if the online query suddenly slows down
- ③ 关系数据库标准语言SQL 数据查询(SELECT)
- "NIO Cup" 2022 Nioke Summer Multi-School Training Camp 4 ADHK Problem Solving
- 小程序onPageNotFound的坑
- WinForm (5) control and its members
猜你喜欢
[21 Days Learning Challenge] Half Insertion Sort
20张图,全面掌握MVCC原理!
ADC和DAC记录
【openpyxl】过滤和排序
Two-dimensional array combat project -------- "Minesweeper Game"
③ 关系数据库标准语言SQL 数据查询(SELECT)
力扣------用栈操作构建数组
apache+PHP+MySQL+word press, page error when installing word press?
Apache Commons Configuration Remote Code Execution Vulnerability (CVE-2022-33980) Analysis & Reproduction
数据分析面试手册《统计篇》
随机推荐
关于科研学习中的几个问题:如何看论文?如何评价工作?如何找idea?
异常和异常处理机制
"NIO Cup" 2022 Nioke Summer Multi-School Training Camp 4 ADHK Problem Solving
Apache Commons Configuration远程代码执行漏洞(CVE-2022-33980)分析&复现
"NIO Cup" 2022 Nioke Summer Multi-School Training Camp 3 DF Problem Solving
16. 最接近的三数之和
【pypdf2】安装、读取和保存、访问页面、获取文本、读写元数据、加密解密
Word set before the title page
Volatile和CAS
Distributed. Performance optimization
EPro-PnP: Generalized End-to-End Probabilistic Perspective-n-Points for Monocular Object Pose Est...
networkmanager无法打开
成功解决TypeError: can‘t multiply sequence by non-int of type ‘float‘
BEVDepth: Acquisition of Reliable Depth for Multi-view 3D Object Detection 论文笔记
【openpyxl】过滤和排序
【考虫 六级英语】语法课笔记
Shell Text Three Musketeers Sed
[Server data recovery] Data recovery case of lvm information and VXFS file system corruption caused by raid5 crash
使用mysql语句操作数据表(table)
@Autowired注入RedisCache报错空指针