# 商

商是除法的结果：当 a 除以 b 时，满足 \( b \cdot x = a \) 的数 x，其中 a 称为被除数，b 称为除数<sup>[1](https://encyclopediaofmath.org/wiki/Division)</sup>。在数学中，这个词还有第二层更宽泛的含义：商是按照等价关系对已有对象的元素进行认同而构造出的新对象，如商集、商群和商环<sup>[2](https://github.com/UdaraJay/Maths/blob/main/02-sets-functions-relations/quotient.md)</sup>。两种含义共享同一个想法：取一个整体，把相等的部分视为一体，缩减为剩余之物。

| 关键事实 | 详情 |
|---|---|
| 除法意义 | 商是除法的结果 x，除法是乘法的逆运算；除法写作 \( a : b \)、\( \frac{a}{b} \) 或 \( a/b \)<sup>[1](https://encyclopediaofmath.org/wiki/Division)</sup> |
| 欧几里得除法 | 对任意整数 a 和 b > 0，存在唯一的 q 和 r，使得 \( a = q \cdot b + r \) 且 \( 0 \le r < b \)；q 为商，r 为余数<sup>[3](https://www.cs.cornell.edu/courses/cs2800/2017sp/lectures/lec29-division.html)</sup> |
| 计算示例 | 41 除以 7 的欧几里得除法给出商 5 和余数 6，因为 \( 41 = 7 \cdot 5 + 6 \)<sup>[4](https://lexique.netmath.ca/en/euclidean-division/)</sup> |
| 商结构意义 | 对集合 A 上的等价关系 ~，商集 \( A/\sim \) 以等价类 \( [a] \) 为元素<sup>[2](https://github.com/UdaraJay/Maths/blob/main/02-sets-functions-relations/quotient.md)</sup> |
| 良定义性 | 类上的运算如 \( [a] + [b] = [a+b] \) 只有在更换代表元不改变结果类时才有效<sup>[2](https://github.com/UdaraJay/Maths/blob/main/02-sets-functions-relations/quotient.md)</sup> |
| 计算约定 | Scheme 的 SRFI 141 规定了六对整数除法算子：向下取整、向上取整、截断、就近取整、欧几里得和平衡，每对返回商和余数<sup>[5](https://srfi.schemers.org/srfi-141/srfi-141.html)</sup> |
| 软件名称 | 整数除法在 Wolfram 语言中实现为 `Quotient[a, b]`<sup>[6](https://mathworld.wolfram.com/IntegerDivision.html)</sup> |

## 除法的商

除法回答的是一个数包含另一个数多少次的问题。《数学百科全书》将其定义为乘法的逆运算：给定 a 和 b，求 x 使得 \( b \cdot x = a \) 或 \( x \cdot b = a \)；结果 x 即为商，也称 a 与 b 之比<sup>[1](https://encyclopediaofmath.org/wiki/Division)</sup>。在有理数域中，除法除零以外总是可行的，且结果唯一。在整数环中则不然：10 能被 5 整除，但不能被 3 整除。当整数 a 除以整数 b 得到整数商时，称 a 被 b 整除，记作 \( b \mid a \)<sup>[1](https://encyclopediaofmath.org/wiki/Division)</sup>。

**带余除法。** 当被除数不是除数的精确倍数时，整数除法产生两个结果。一种理解方式是反复减法：从 a 中减去 b，再减去 b，如此继续直到结果小于 b。减法的次数即为商，剩余的部分即为余数<sup>[7](https://math-sites.uncg.edu/sites/pauli/112/HTML/secquorem.html)</sup>。形式上，欧几里得除法算法指出，对任意整数 a 和 b > 0，存在 q 和 r 使得 \( a = q \cdot b + r \) 且 \( 0 \le r < b \)，并且这对数是唯一的：若 \( a = q \cdot b + r = q' \cdot b + r' \) 且两个余数均在范围内，则 \( q = q' \) 且 \( r = r' \)<sup>[3](https://www.cs.cornell.edu/courses/cs2800/2017sp/lectures/lec29-division.html)</sup>。正是唯一性使商成为 a 和 b 的良定义函数<sup>[3](https://www.cs.cornell.edu/courses/cs2800/2017sp/lectures/lec29-division.html)</sup>。

同一定理也可表述为除数限制为正整数 \( d \in \mathbb{P} \)、被除数为任意整数 \( n \in \mathbb{Z} \)：存在唯一整数 q 和 r，使得 \( n = q \cdot d + r \) 且 \( 0 \le r < d \)<sup>[8](https://math.umd.edu/~pbrosnan/notes/ugalg/sect0005.html)</sup>。当余数为零时，被除数是除数的倍数<sup>[4](https://lexique.netmath.ca/en/euclidean-division/)</sup>。

对非负的 a 和正的 b，商和余数由 \( q = \lfloor a/b \rfloor \) 和 \( r = a - b \cdot q \) 刻画<sup>[6](https://mathworld.wolfram.com/IntegerDivision.html)</sup>。舍去小数部分的除法称为整数除法<sup>[6](https://mathworld.wolfram.com/IntegerDivision.html)</sup>。

## 商作为数学对象

在代数和拓扑学中，商是按照等价关系认同元素而得到的新对象。若 ~ 是集合 A 上的等价关系，商集为 \( A/\sim = \{[a] \mid a \in A\} \)，其元素为等价类<sup>[2](https://github.com/UdaraJay/Maths/blob/main/02-sets-functions-relations/quotient.md)</sup>。这一构造把“在此目的下相同”变为新对象中的字面相等：商不再携带同一想法的多个代表元，而是将每个完整的类视为一个对象<sup>[2](https://github.com/UdaraJay/Maths/blob/main/02-sets-functions-relations/quotient.md)</sup>。

常见的例子包括模 n 的整数、作为整数对 \( (a, b) \)（\( b \ne 0 \)）的等价类的有理数、商群、商环，以及通过认同区间端点得到的圆<sup>[2](https://github.com/UdaraJay/Maths/blob/main/02-sets-functions-relations/quotient.md)</sup>。这类商在模算术、有理数、群论和拓扑学中处于核心地位<sup>[2](https://github.com/UdaraJay/Maths/blob/main/02-sets-functions-relations/quotient.md)</sup>。

**良定义的运算。** 通过选取代表元在类上定义运算，需要证明结果不依赖于选择。规则 \( [a] + [b] = [a+b] \) 只有在 \( a \sim a' \) 且 \( b \sim b' \) 蕴含 \( a + b \sim a' + b' \) 时才有效；缺少这一检验，公式可能依赖于任意选择<sup>[2](https://github.com/UdaraJay/Maths/blob/main/02-sets-functions-relations/quotient.md)</sup>。典型错误包括：将等价类误认为其某个特定代表元、未能证明运算是良定义的、把商记号当作普通除法来读，以及以为商构造保留了原对象的所有性质。<sup>[2](https://github.com/UdaraJay/Maths/blob/main/02-sets-functions-relations/quotient.md)</sup>

## 计算示例：模 5 的整数

在 \( \mathbb{Z}/5\mathbb{Z} \) 中，类 \( [7] \) 等于 \( [2] \)，因为 \( 7 - 2 = 5 \)<sup>[2](https://github.com/UdaraJay/Maths/blob/main/02-sets-functions-relations/quotient.md)</sup>。加法和乘法在代表元上定义，然后检验良定义性：

\[ [4] + [3] = [7] = [2] \]

\[ [4] \cdot [3] = [12] = [2] \]

该商恰好有五个元素：\( [0], [1], [2], [3], [4] \)<sup>[2](https://github.com/UdaraJay/Maths/blob/main/02-sets-functions-relations/quotient.md)</sup>。

## 计算中的商

当操作数可能为负时，编程语言必须为商确定一种约定，而各语言并不一致。Scheme 的 SRFI 141 规定了六对除法算子：向下取整、向上取整、截断、就近取整、欧几里得和平衡，每对提供三个过程：一个同时返回商和余数，一个只返回商，一个只返回余数。每对通过用分子 n 和分母 d 指定商 q 来定义，余数随后由 \( r = n - d \cdot q \) 确定<sup>[5](https://srfi.schemers.org/srfi-141/srfi-141.html)</sup>。

各对的区别在于 q 的选取方式。向下取整对取 \( q = \lfloor n/d \rfloor \)，因此非零余数仅在 d 为负时为负；向上取整对取 \( q = \lceil n/d \rceil \)；截断对取 \( q = \mathrm{truncate}(n/d) \)，向零舍入，因此非零余数仅在 n 为负时为负；就近取整对舍入到最近整数，与两个整数距离相等时取偶整数<sup>[5](https://srfi.schemers.org/srfi-141/srfi-141.html)</sup>。欧几里得对在 \( d > 0 \) 时取 \( q = \lfloor n/d \rfloor \)，在 \( d < 0 \) 时取 \( q = \lceil n/d \rceil \)，这保证了数学中使用的更强条件 \( 0 \le r < |d| \)；平衡对保证 \( -|d/2| \le r < |d/2| \)<sup>[5](https://srfi.schemers.org/srfi-141/srfi-141.html)</sup>。因此欧几里得余数始终是长度至少为分母绝对值的向量的有效索引<sup>[5](https://srfi.schemers.org/srfi-141/srfi-141.html)</sup>。

Python 在其算子中体现了同样的区分。`/` 算子给出其参数的商，整数相除产生浮点数，而 `//` 执行向下取整除法，即对结果应用向下取整函数的数学除法。`%` 算子给出余数，两者由恒等式 \( x = (x \,//\, y) \cdot y + (x \,\%\, y) \) 联系<sup>[9](https://github.com/python/cpython/blob/main/Doc/reference/expressions.rst)</sup>。在 Wolfram 语言中，整数除法是函数 `Quotient[a, b]`；例如 \( 10/3 = 3 + 1/3 \) 为精确除法，而整数商 \( 10 \backslash 3 = 3 \)<sup>[6](https://mathworld.wolfram.com/IntegerDivision.html)</sup>。

对于大整数，商的计算可以归约为乘法。给定基数 \( B > 1 \) 和满足 \( a \le B^{h} \) 的 h，瓦特在 2023 年证明，对某个 \( \delta \in \{0, 1\} \)，

\[ q = \left\lfloor \frac{a}{b} \right\rfloor = \left\lfloor \frac{a \cdot \lfloor B^{h}/b \rfloor}{B^{h}} \right\rfloor + \delta \]

因此乘以 \( \lfloor B^{h}/b \rfloor \) 再作基数 B 移位，得到商或比商小一，余数由 \( r = a - b \cdot q \) 恢复<sup>[6](https://mathworld.wolfram.com/IntegerDivision.html)</sup>。

## 历史注记

在古希腊，普通分数被用于计算，但分数本身不被视为一个数，而只是自然数的商<sup>[10](https://encyclopediaofmath.org/index.php?lang=en&title=Arithmetic)</sup>。花拉子米（Muhammad Al-Khwarizmi）写于九世纪的算术论著在传播印度十进制记数法以及加、减、乘、除和开平方技术方面发挥了重要作用<sup>[10](https://encyclopediaofmath.org/index.php?lang=en&title=Arithmetic)</sup>。在古埃及，书吏做除法时反复将除数加倍并从被除数中减去所得值，这种方法与将商视为反复减法的观点密切相关。<sup>[10](https://encyclopediaofmath.org/index.php?lang=en&title=Arithmetic)</sup>

## References

1. [Division, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Division)
2. [Quotient, Maths notes on sets, functions and relations (GitHub)](https://github.com/UdaraJay/Maths/blob/main/02-sets-functions-relations/quotient.md)
3. [Lecture 29: Euclidean division, CS 2800, Cornell University](https://www.cs.cornell.edu/courses/cs2800/2017sp/lectures/lec29-division.html)
4. [Euclidean Division, Netmath Mathematical Lexicon](https://lexique.netmath.ca/en/euclidean-division/)
5. [SRFI 141: Integer division, Scheme Requests for Implementation](https://srfi.schemers.org/srfi-141/srfi-141.html)
6. [Integer Division, Wolfram MathWorld](https://mathworld.wolfram.com/IntegerDivision.html)
7. [Section 3.1 Quotients and Remainders, University of North Carolina at Greensboro](https://math-sites.uncg.edu/sites/pauli/112/HTML/secquorem.html)
8. [The division algorithm with remainder, UMD 403 Undergraduate Algebra](https://math.umd.edu/~pbrosnan/notes/ugalg/sect0005.html)
9. [Python language reference, expressions (CPython documentation)](https://github.com/python/cpython/blob/main/Doc/reference/expressions.rst)
10. [Arithmetic, Encyclopedia of Mathematics](https://encyclopediaofmath.org/index.php?lang=en&title=Arithmetic)

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

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Number theory › Elementary number theory › Divisibility, GCD, and the integers

Copyright 2026 Edgepedia

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

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

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