# 操作数

**操作数**（operand）是运算所作用的对象：在数学中，是运算符所作用的数、变量或函数；在计算中，是指令或表达式所操作的数据。<sup>[1](https://www.techtarget.com/whatis/definition/operand)</sup>在表达式 7 + 5 = 12 中，数字 7 和 5 是操作数，加号是运算符，12 是结果。<sup>[2](https://techterms.com/definition/operand)</sup>该词源自拉丁语 *operandum*，即 *operari*（意为“工作、劳作”）的中性动形词，1886 年作为数学术语进入英语，意为“被运算的量或符号”。<sup>[3](https://www.etymonline.com/word/operand)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 数学运算或逻辑运算的对象；运算符所作用的数据<sup>[1](https://www.techtarget.com/whatis/definition/operand)</sup> |
| 词源 | 英语中自 1886 年起使用，源自拉丁语 *operandum*，意为“被作用之物”，出自 *operari*“工作”<sup>[3](https://www.etymonline.com/word/operand)</sup><sup> • </sup><sup>[4](https://www.collinsdictionary.com/dictionary/english/operand)</sup> |
| 元数 | 运算符按其所取操作数的数量分类：一元（一个）、二元（两个）、三元（三个）<sup>[5](https://icarus.cs.weber.edu/~dab/cs1410/textbook/2.Core/operators.html)</sup> |
| 可作为操作数者 | 常量、变量以及返回值的函数均可作为操作数<sup>[5](https://icarus.cs.weber.edu/~dab/cs1410/textbook/2.Core/operators.html)</sup> |
| 机器层面 | 在典型指令中，操作数是存储地址或标识待处理数据的常量<sup>[6](https://www.ojp.gov/pdffiles1/Digitization/61550NCJRS.pdf)</sup> |
| 求值顺序 | 在 C#、JavaScript、Rust 等语言中，操作数从左到右求值，与运算符优先级无关<sup>[7](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/)</sup><sup> • </sup><sup>[8](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence)</sup> |

## 数学中的操作数

在数学中，操作数是数学运算的对象。操作数与运算符结合，构成表达式和方程式，其产生的值取决于运算符和操作数的位置。操作数可以是数、代表数的变量，或返回数的函数；在表达式 2 + 3 × 4 中有三个操作数（2、3 和 4），以及一个加法和一个乘法运算符。<sup>[1](https://www.techtarget.com/whatis/definition/operand)</sup>各家词典的定义在范围上是一致的：柯林斯称之为“数学运算或逻辑运算所作用的量或函数”，<sup>[4](https://www.collinsdictionary.com/dictionary/english/operand)</sup>剑桥则举例说，在 7 + y 中，7 和 y 都是操作数。<sup>[9](https://dictionary.cambridge.org/us/dictionary/english/operand)</sup>

每个算术表达式至少有一个操作数。有些运算，如对 9 开平方，只有一个操作数；另一些运算，如 12 − 5，有两个操作数。<sup>[10](https://www.mathnasium.com/math-terms/operand)</sup>运算符可以视为函数，其操作数则是该函数的输入，即自变量。<sup>[11](https://www.allmathwords.org/en/o/operand.html)</sup>

## 编程语言中的操作数

编程语言继承了数学的词汇。运算符对值执行某种过程，运算符可作用于不同数量的操作数：通常是一个（一元）、两个（二元）或三个（三元）。<sup>[12](https://openstax.org/books/introduction-computer-science/pages/7-2-programming-language-constructs)</sup>在 C++ 中，条件运算符 `op1 ? op2 : op3` 是该语言唯一的三元运算符，取三个操作数，由两个符号分隔；而一元运算符如 `-N` 中的取负，只取一个操作数。<sup>[5](https://icarus.cs.weber.edu/~dab/cs1410/textbook/2.Core/operators.html)</sup>

**操作数的种类。** 常量、变量以及非 void 函数返回的值均可作为操作数，程序员可以在表达式中混用它们；在 `2 * A + 5 * B` 中，子表达式 `2 * A` 和 `5 * B` 本身就是 `+` 的左操作数和右操作数。<sup>[5](https://icarus.cs.weber.edu/~dab/cs1410/textbook/2.Core/operators.html)</sup>编程语言还支持算术之外的运算符类型，包括逻辑运算符、比较运算符和赋值运算符，它们各自作用于自己的操作数。<sup>[1](https://www.techtarget.com/whatis/definition/operand)</sup>

**操作数类型与重载。** 运算符符号通常是重载的，即同一符号根据其操作数的类型执行不同的操作。在典型语言中，`+` 作用于两个整数得到整数，作用于一个整数和一个浮点数得到浮点数，作用于两个字符串则将其拼接（"2" + "4" 得到 "24"），而字符串加整数可能是错误，因为该运算未对这些操作数类型定义。<sup>[13](https://textbooks.cs.ksu.edu/cc210/02-data-types-math/06-more-on-operations/)</sup>给定运算符与操作数组合时适用哪种行为，因语言而异，因此语言文档是权威参考。<sup>[13](https://textbooks.cs.ksu.edu/cc210/02-data-types-math/06-more-on-operations/)</sup>

## 机器指令中的操作数

在机器层面，操作数呈现出不同的形式。在大多数采用单地址指令集的计算机中，每条指令有两个主要部分：一个操作，如加、减、乘或转移控制；以及一个操作数，即存储地址或常量。操作数标明待处理数据的内存位置，或数据本身，视命令类型而定；一条操作为“加”、操作数为“z”的指令，指明了第二个值来自何处。<sup>[6](https://www.ojp.gov/pdffiles1/Digitization/61550NCJRS.pdf)</sup>一般而言，在计算中，操作数往往引用内存位置或寄存器，而非字面常量。<sup>[14](https://en.alegsaonline.com/art/72806)</sup>MDN 的术语表概括了这两种语境之间的联系：操作数是指令中代表被运算符操作的数据的部分。<sup>[15](https://developer.mozilla.org/en-US/docs/Glossary/Operand)</sup>

## 分组与求值顺序之别

一个常引起混淆的区别是：优先级和结合性将运算符与操作数分组，但并不决定操作数的求值顺序。在 JavaScript 中，运算符优先级和结合性只影响运算符的隐式分组；操作数本身始终从左到右求值，因此在 `echo("left", 4) ** echo("middle", 3) ** echo("right", 2)` 中，三个调用表达式按书写顺序执行，尽管幂运算符是右结合的。<sup>[8](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence)</sup>C# 明确陈述了同样的规则：与优先级和结合性无关，表达式中的操作数从左到右求值，因此 `a + b * c` 先求 a，再求 b，再求 c，然后应用 `*`，最后应用 `+`。<sup>[7](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/)</sup>Rust 同样规定，含有多个操作数的表达式会按源代码中书写的顺序从左到右对这些操作数求值，操作数在表达式的效果生效之前求值。<sup>[16](https://doc.rust-lang.org/reference/expressions.html)</sup>

**条件求值。** 通常运算符的所有操作数都会被求值，但有些运算符有条件地求值操作数：最左侧操作数的值决定是否求值其他操作数，以及求值哪些操作数。在 C# 中，这些是条件逻辑与（`&&`）和条件逻辑或（`||`）、null 合并运算符 `??` 和 `??=`、null 条件运算符 `?.` 和 `?[]`，以及条件运算符 `?:`。<sup>[7](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/)</sup>在 JavaScript 中，这种行为称为短路：在 `a && (b + c)` 中，若 `a` 为假值，子表达式 `(b + c)` 根本不会被求值，尽管它的分组优先级高于 `&&`；只有当左操作数无法确定结果时，才求值右操作数。<sup>[8](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence)</sup>入门教材中也有同样的说法：若 `||` 的左操作数求值为真，则整个表达式为真，右侧无需再求值，从而提高效率。<sup>[12](https://openstax.org/books/introduction-computer-science/pages/7-2-programming-language-constructs)</sup>

**结合性与操作数性质。** 操作数本身的性质可能限制编译器可以做的重排。在 C 中，位运算符 `&`、`|` 和 `^` 满足结合律，算术运算符 `+` 和 `*` 在操作数类型为无符号时满足结合律，因此将四个函数结果相加的表达式可以按任意顺序合并。有符号整数的算术并不总是满足结合律，因为可能溢出；浮点算术实际上也不满足结合律，因此这些加法必须遵循规定的顺序；GCC 选项 `-funsafe-math-optimizations` 允许编译器重排那些在精确数学中满足结合律的计算。<sup>[17](https://www.gnu.org/software/c-intro-and-ref/manual/html_node/Associativity-and-Ordering.html)</sup>

## 记法

熟悉的书写形式 `操作数1 运算符 操作数2`，如 `2 + 4`，称为中缀记法。另一种记法——前缀记法——将运算符写在前面，如 `+ 2 4`；前缀形式在编写编程语言处理器时技术上更为简便，前缀风格的记法也出现在面向对象的方法调用中。<sup>[13](https://textbooks.cs.ksu.edu/cc210/02-data-types-math/06-more-on-operations/)</sup>

## References

1. [What is an operand in mathematics and computing? – TechTarget, Robert Sheldon (Nov 3, 2022)](https://www.techtarget.com/whatis/definition/operand)
2. [Operand Definition, TechTerms](https://techterms.com/definition/operand)
3. [Operand (n.) – Origin and history of operand, Online Etymology Dictionary](https://www.etymonline.com/word/operand)
4. [Operand definition and meaning, Collins English Dictionary](https://www.collinsdictionary.com/dictionary/english/operand)
5. [2.1. Operators and Operands, Weber State University CS 1410 textbook](https://icarus.cs.weber.edu/~dab/cs1410/textbook/2.Core/operators.html)
6. [Computer instruction makeup: operation and operand, U.S. Department of Justice digitized document](https://www.ojp.gov/pdffiles1/Digitization/61550NCJRS.pdf)
7. [Operators and expressions – C# reference, Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/)
8. [Operator precedence – JavaScript, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence)
9. [OPERAND meaning in English, Cambridge English Dictionary](https://dictionary.cambridge.org/us/dictionary/english/operand)
10. [What Is an Operand in Math? A Kid-Friendly Definition, Mathnasium Glossary](https://www.mathnasium.com/math-terms/operand)
11. [Operand, All Math Words Encyclopedia, David E. McAdams](https://www.allmathwords.org/en/o/operand.html)
12. [7.2 Programming Language Constructs, Introduction to Computer Science, OpenStax](https://openstax.org/books/introduction-computer-science/pages/7-2-programming-language-constructs)
13. [More on Operations, CC 210 Textbook, Kansas State University](https://textbooks.cs.ksu.edu/cc210/02-data-types-math/06-more-on-operations/)
14. [Operand (mathematics): definition, types, and usage, AlegsaOnline](https://en.alegsaonline.com/art/72806)
15. [Operand – Glossary, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Glossary/Operand)
16. [Expressions – Evaluation order of operands, The Rust Reference](https://doc.rust-lang.org/reference/expressions.html)
17. [Associativity and Ordering, GNU C Language Manual](https://www.gnu.org/software/c-intro-and-ref/manual/html_node/Associativity-and-Ordering.html)

---
*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 › Elementary and formal arithmetic › Elementary arithmetic operations

Copyright 2026 Edgepedia

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

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

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