# 整数

整数是不带小数部分的数，可以是正数、负数或零：整数集 ℤ 由自然数、数字 0 以及自然数的加法逆元 −1、−2、−3 等组成。<sup>[1](https://mosullivan.sdsu.edu/Teaching/AlgGeo25S/GroupsRingsFields-master.pdf)</sup> 整数在加法、减法和乘法下封闭，这使它们区别于自然数（减法可能不封闭）和有理数（除法可能不封闭）。符号 ℤ 来自德语 *Zahlen*（数）。

| 关键事实 | 详情 |
|---|---|
| 定义 | ℤ = 自然数、0 以及负数 −1、−2、−3、……<sup>[1](https://mosullivan.sdsu.edu/Teaching/AlgGeo25S/GroupsRingsFields-master.pdf)</sup> |
| 代数结构 | 整数在普通加法和乘法下构成一个交换环；它们不是域，因为两个整数相除未必仍是整数<sup>[1](https://mosullivan.sdsu.edu/Teaching/AlgGeo25S/GroupsRingsFields-master.pdf)</sup> |
| 序 | 带有通常运算的 ℤ 是一个有序环，且正整数是良序的：它们的任意非空子集都有最小元素<sup>[2](https://www.math.unm.edu/~buium/umath.pdf)</sup><sup> • </sup><sup>[3](https://math.umd.edu/~pbrosnan/notes/ugalg/sect0002.html)</sup> |
| 最早的负数 | 约在公元前 200 年至公元 200 年间用于中国，约在公元 7 世纪由婆罗摩笈多（Brahmagupta）用于印度<sup>[4](https://ximera.osu.edu/m4t/elementaryTeachersOne/elementaryReading/Integers/IntegersHistory)</sup> |
| 在欧洲被完全接受 | 西欧数学家从 17 世纪起在计算中使用负数，但直到 19 世纪才赋予其平等地位<sup>[4](https://ximera.osu.edu/m4t/elementaryTeachersOne/elementaryReading/Integers/IntegersHistory)</sup> |
| 应用 | 整数上的整除性、素数和模算术支撑着 RSA、Diffie–Hellman 密钥交换和椭圆曲线密码学<sup>[5](https://www.handbooks.uwa.edu.au/unitdetails?code=MATH2065)</sup> |
| 在计算中 | Java 的 `int` 是 32 位有符号二进制补码整数，取值范围从 −2147483648 到 2147483647，而 Python 的整数具有无限精度<sup>[6](https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html)</sup><sup> • </sup><sup>[7](https://docs.python.org/3/library/stdtypes.html?highlight=str+format)</sup> |

## 代数结构

整数是交换环的原型：加法和乘法满足结合律和交换律，乘法对加法满足分配律，0 和 1 充当单位元，每个整数 n 都有加法逆元 −n。<sup>[1](https://mosullivan.sdsu.edu/Teaching/AlgGeo25S/GroupsRingsFields-master.pdf)</sup> 整数所缺少的是乘法逆元：3 除以 5 不是整数，因此 ℤ 是环而不是域。

ℤ 也是一个有序环，其序与算术以熟悉的方式相互作用：加上一个正整数保持不等号方向不变。<sup>[2](https://www.math.unm.edu/~buium/umath.pdf)</sup> 正整数特有的一个性质是良序性：正整数的任意非空子集都有最小元素。这条公理本质上等价于数学归纳法原理，它驱动了许多基本证明，包括每个大于 1 的整数都有素因子。<sup>[3](https://math.umd.edu/~pbrosnan/notes/ugalg/sect0002.html)</sup>

## 基础与构造

现代处理方式将整数建立在自然数之上，而自然数本身由皮亚诺（Peano）公理刻画。这些公理的简化形式设定了一个集合 ℕ 以及一个单射但非满射的后继函数 s，因此存在一个元素 0 不是任何元素的后继，同时还有一条归纳公理：任何包含 0 且对 s 封闭的子集必定是整个 ℕ。<sup>[8](https://www.southampton.ac.uk/~wright/1001/the-axioms.html)</sup> 仅前两条公理就生成无限列表 0、s(0)、s(s(0))、……，但其他集合（例如非负有理数）也满足它们；归纳公理才是精确锁定自然数的那一条。<sup>[8](https://www.southampton.ac.uk/~wright/1001/the-axioms.html)</sup>

从自然数出发，可以形式化地构造整数，例如用自然数对来表示差，并用等价关系把表示同一差的数对等同起来，使得 1 − 3 和 2 − 4 命名同一个整数。<sup>[9](https://connect.gonzaga.edu/asset/file/1472/ch01_supplement_N_v02.html)</sup>

## 数论

数论的很大一部分是研究整数。当存在整数 c 使得 b = ac 时，称整数 a 整除 b，记作 a | b；素数是恰好有两个正因子（1 和自身）的正整数。<sup>[3](https://math.umd.edu/~pbrosnan/notes/ugalg/sect0002.html)</sup> 每个正整数都有唯一的素因数分解，即任何两个乘积为 n 的素数列表在不计顺序的意义下完全相同。<sup>[3](https://math.umd.edu/~pbrosnan/notes/ugalg/sect0002.html)</sup>

这些结构有直接的实践后果。模算术、同余、最大公约数、贝祖（Bézout）定理和欧拉（Euler）函数都是关于整数的命题，它们转化为密码学协议：RSA、Diffie–Hellman 密钥交换和椭圆曲线密码学都依赖于因数分解和离散对数问题等数论问题，其计算难度保障了现代数字通信的安全。<sup>[5](https://www.handbooks.uwa.edu.au/unitdetails?code=MATH2065)</sup>

## 负数的历史

正整数历史悠久；约在公元前 3000 年的古埃及就出现了非负整数的证据，巴比伦人在同一时期使用了六十进制位值制。<sup>[4](https://ximera.osu.edu/m4t/elementaryTeachersOne/elementaryReading/Integers/IntegersHistory)</sup> 负数出现得晚得多，并遭遇了持续的抵制。

已知最早的负数出现在约公元前 200 年至公元 200 年间的中国数学中。在《九章算术》中，负数被用于求解联立方程组，红色算筹表示正系数，黑色算筹表示负系数，并给出了正负数的运算法则。<sup>[10](https://web.ma.utexas.edu/users/mks/326K/Negnos.html)</sup> 中国的算筹制度在商业中使用颜色：收到的钱为正，付出的钱为负，因此余额为正，亏欠为负。<sup>[11](https://nrich.maths.org/articles/history-negative-numbers)</sup>

在印度，负数出现在约公元 620 年婆罗摩笈多（598–670）的著作中，他使用财富与债务的概念，陈述了正负量的运算法则，包括两个债务的乘积或商是财富，而债务与财富的乘积是债务。<sup>[11](https://nrich.maths.org/articles/history-negative-numbers)</sup>

古希腊人基本上回避了这个问题，因为他们的数学建立在几何之上：来自几何构造的长度、面积和体积必须是正的，量用线段和面积而非数字来表示。<sup>[11](https://nrich.maths.org/articles/history-negative-numbers)</sup> 亚里士多德（Aristotle）区分了数（自然数）和量，没有任何负量的迹象，欧几里得（Euclid）《几何原本》中数论各卷也不包含负数。<sup>[10](https://web.ma.utexas.edu/users/mks/326K/Negnos.html)</sup> 西方著作中关于负数的第一个迹象出现在公元 3 世纪，丢番图（Diophantus）在其《算术》中称方程 4x + 20 = 0 是荒谬的，因为它会给出 x = −4。<sup>[10](https://web.ma.utexas.edu/users/mks/326K/Negnos.html)</sup>

在中世纪阿拉伯数学中，负数基本上只出现在一个地方：10 世纪数学家阿布·瓦法（Abu'l-Wafa，940–998）在一部为书记员和商人写的算术著作中用它们表示债务。<sup>[11](https://nrich.maths.org/articles/history-negative-numbers)</sup> 负数直到 15 世纪才传入欧洲，当时学者们翻译重新发现的古代文本，而二次和三次方程的求解推动了这一问题的进展。早期欧洲的命名反映了这种不适：卡尔达诺（Cardano）在 1545 年的《大衍术》中称负根为 *numeri ficti*（虚构的数），施蒂费尔（Stifel）在 1544 年称它们为 *numeri absurdi*，罗伯特·雷科德（Robert Recorde）在 1557 年写道：“8 − 12 是一个荒谬的数。因为它比零还少 4。”<sup>[12](https://mathshistory.st-andrews.ac.uk/Miller/mathword/n/)</sup>

到 17 和 18 世纪，数学家们在方程理论和微积分中经常使用负数和虚数，尽管对其意义仍感不安。<sup>[11](https://nrich.maths.org/articles/history-negative-numbers)</sup> 约翰·沃利斯（John Wallis，1616–1703）因发明数轴而被认为赋予了负数意义。<sup>[11](https://nrich.maths.org/articles/history-negative-numbers)</sup> 完整的理论基础在 19 世纪到来：乔治·皮科克（George Peacock）区分了“算术代数”（其中 a − b 仅在 b < a 时有意义）和“符号代数”（其中 a − b 总有意义，负数只是形如 −a 的符号）；威廉·哈密顿（William Hamilton）试图通过他的“纯时间”概念为负数奠定基础，这一努力虽然今天看来古怪，却促进了四元数的发展。<sup>[10](https://web.ma.utexas.edu/users/mks/326K/Negnos.html)</sup> MacTutor 的历史综述指出，即使是我们现在视为最基本概念的整数，也带有一种只有通过考察这一历史背景才能恰当理解的复杂性。<sup>[13](https://mathshistory.st-andrews.ac.uk/HistTopics/History_overview/)</sup>

## 计算中的整数

编程语言用有限存储表示整数，这改变了它们的行为。Java 定义了四种有符号整数类型：`byte`、`short`、`int` 和 `long`，分别为 8、16、32 和 64 位二进制补码形式；`int` 类型取值范围从 −2147483648 到 2147483647，其运算符不以任何方式指示溢出，因此溢出的加法产生数学和的低位部分。<sup>[6](https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html)</sup> 在 C++ 中，宽度为 N 的每种有符号整数类型表示从 −2<sup>N−1</sup> 到 2<sup>N−1</sup>−1 的值，对应的无符号类型表示 0 到 2<sup>N</sup>−1，算术按模 2<sup>N</sup> 进行，有符号溢出导致未定义行为。<sup>[14](https://www.eel.is/c%2B%2Bdraft/basic.fundamental)</sup>

Python 采取相反的方法：其整数具有无限精度，CPython 实现将它们存储为任意长度的二进制数（大数）。<sup>[7](https://docs.python.org/3/library/stdtypes.html?highlight=str+format)</sup> 代价出现在转换而非存储上：除非基数是 2 的幂，否则没有已知算法能在线性时间内完成字符串与二进制整数之间的转换，因此 CPython 对十进制字符串转换施加了可配置的默认限制 4300 位，以缓解拒绝服务攻击。<sup>[7](https://docs.python.org/3/library/stdtypes.html?highlight=str+format)</sup>

## 学习整数

整数运算是数学教育中已知的难点。美国国家研究委员会的报告《加入它》（*Adding It Up*）指出，与非负整数和有理数相比，关于学生如何获得负数理解的研究相对较少，并列举了引入负数时使用的隐喻：电梯、温度计、债务与资产、损失与收益、热气球以及数轴上的有向箭头。<sup>[15](https://www.nationalacademies.org/read/9822/chapter/9)</sup> 学生在解决以故事情境或数轴移动方式呈现的整数问题时，通常比解决以形式方程呈现的同样问题表现更好。<sup>[15](https://www.nationalacademies.org/read/9822/chapter/9)</sup>

常见的误解持续存在。对职前小学教师的研究发现，在数轴上放置负小数时存在两种主要错误，包括将正负两侧视为按情境对齐的独立“射线”而非一条连续直线。<sup>[16](https://www.sciencedirect.com/science/article/pii/S0732312310000581)</sup> 对幼儿的研究表明，他们在处理负数时最初过度依赖非负整数的值和顺序，而对负数性质的集中探索有助于他们转向比仅基于数轴上正负方向移动的教学更复杂的心理模型。<sup>[17](https://eric.ed.gov/?id=ED584922)</sup> 一项 2025 年对中学生的研究发现，一些学生将负整数放在零的右侧，这表明如果没有对负号方向意义的引导性解释，仅靠表征是不够的。<sup>[18](https://www.frontiersin.org/journals/education/articles/10.3389/feduc.2026.1739073/full)</sup>

## References

1. [The Ring of Integers, M. O'Sullivan, San Diego State University](https://mosullivan.sdsu.edu/Teaching/AlgGeo25S/GroupsRingsFields-master.pdf)
2. [Undergraduate Mathematics, Chapter on the Integers, S. Buium, University of New Mexico](https://www.math.unm.edu/~buium/umath.pdf)
3. [UMD 403: Undergraduate Algebra, Notation and Well-Ordered Property, P. Brosnan, University of Maryland](https://math.umd.edu/~pbrosnan/notes/ugalg/sect0002.html)
4. [History of Integers, Ximera, Ohio State University](https://ximera.osu.edu/m4t/elementaryTeachersOne/elementaryReading/Integers/IntegersHistory)
5. [Number Theory and Cryptography (MATH2065), Handbook 2026, University of Western Australia](https://www.handbooks.uwa.edu.au/unitdetails?code=MATH2065)
6. [The Java Language Specification, Java SE 21, §4.2 Primitive Types and Values, Oracle](https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html)
7. [Built-in Types, Python 3 documentation, Python Software Foundation](https://docs.python.org/3/library/stdtypes.html?highlight=str+format)
8. [11.1 The Axioms, MATH1001 Introduction to Number Theory, University of Southampton](https://www.southampton.ac.uk/~wright/1001/the-axioms.html)
9. [Math 413 Supplement: Construction of the Natural Numbers and Integers, Gonzaga University](https://connect.gonzaga.edu/asset/file/1472/ch01_supplement_N_v02.html)
10. [M 326K: The History of Negative Numbers, University of Texas at Austin](https://web.ma.utexas.edu/users/mks/326K/Negnos.html)
11. [The History of Negative Numbers, NRICH, University of Cambridge](https://nrich.maths.org/articles/history-negative-numbers)
12. [Earliest Known Uses of Some of the Words of Mathematics (N), MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/Miller/mathword/n/)
13. [History overview, MacTutor History of Mathematics, University of St Andrews](https://mathshistory.st-andrews.ac.uk/HistTopics/History_overview/)
14. [C++ Standard Draft, 6.9.3 Fundamental types](https://www.eel.is/c%2B%2Bdraft/basic.fundamental)
15. [Adding It Up: Helping Children Learn Mathematics, National Research Council (2001), Chapter 7](https://www.nationalacademies.org/read/9822/chapter/9)
16. [Locating negative decimals on the number line, Widjaja, Stacey, and Steinle, Journal of Mathematical Behavior 30 (2011)](https://www.sciencedirect.com/science/article/pii/S0732312310000581)
17. [Transitioning from Whole Numbers to Integers, Bofferding, PME-NA 2012, ERIC ED584922](https://eric.ed.gov/?id=ED584922)
18. [A didactical transposition study on secondary students' number sense of integers, Frontiers in Education (2025)](https://www.frontiersin.org/journals/education/articles/10.3389/feduc.2026.1739073/full)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Arithmetic and number systems › Number systems › Integers and rational numbers

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/integer

English original: https://www.edgepedia.org/integer
