当前位置:网站首页>#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
边栏推荐
- WinForm (5) control and its members
- 【pypdf2】安装、读取和保存、访问页面、获取文本、读写元数据、加密解密
- 关于科研学习中的几个问题:如何看论文?如何评价工作?如何找idea?
- networkmanager无法打开
- HW-蓝队工作流程(1)
- 【考虫 六级英语】语法课笔记
- Only lazy and hungry. You still don't understand the singleton pattern!
- Apache Commons Configuration Remote Code Execution Vulnerability (CVE-2022-33980) Analysis & Reproduction
- Summarize the acquisition of commonly used file information QFileInfo in Qt: suffix, name, path, link
- 微信小程序内部A页面向内嵌H5页面跳转,并且传参
猜你喜欢
Shell编程三剑客之sed
复制带随机指针的链表——LeetCode
C# using timer
MSTP - Multiple Spanning Tree (Case + Configuration)
91.(cesium之家)cesium火箭发射模拟
ArcGIS Pro 创建tpk
③ 关系数据库标准语言SQL 数据查询(SELECT)
时间戳转换为日期格式、获取当前时间戳
R language multiple linear regression, ARIMA analysis of the impact of different candidates in the United States on the economic GDP time series
More parameter exposure of Pico 4: Pancake + color perspective, and Pro version
随机推荐
How to build speed, speed up again
【C语言】探索数据的存储(整形篇)
数据分析面试手册《SQL篇》
百战RHCE(第四十八战:运维工程师必会技-Ansible学习3-构建Ansible清单)
③ 关系数据库标准语言SQL 数据查询(SELECT)
Software Testing Certificate (1) - Software Evaluator
2022.8.10-----leetcode.640
electron -autoUpdater 更新
C# JObject解析JSON数据
nodejs项目连接mysql数据库
YOLOv5的Tricks | 【Trick11】在线模型训练可视化工具wandb(Weights & Biases)
关于科研学习中的几个问题:如何看论文?如何评价工作?如何找idea?
编程技巧│selenium 更新 chromedriver 驱动
分库分表ShardingSphere-JDBC笔记整理
Jvm. Profiling tools (jconsole, jvisualvm, arthas, jprofiler, mat)
云原生-FRP内网穿透(详解)使用云服务器将内网集群服务暴露至公网(二)
全排列思路详解
① 数据库介绍 及 关系型数据库的关系代数表达式
rhel7.0解决yum无法使用(system is not registered to Red Hat Subscription Management)
成功解决TypeError: can‘t multiply sequence by non-int of type ‘float‘