For faster navigation, this Iframe is preloading the Wikiwand page for 運算數.

運算數

數學上的運算數(或稱運算元、operand)是指數學運算的對象,以此進行數學運算[1]

範例

[编辑]

以下的代數運算式可以看到運算数及算子:

其中+是加法的符號,即運算子(operator)。

操作数3是加法的一個操作数,後面跟著算子,操作数'6'是加法的另一個操作数。

運算的結果是9,也稱為加法的和。

運算數也可以稱為是「算子中的一個輸入」。

標示法

[编辑]

以運算式表示的運算數

[编辑]

運算數可以很複雜,也可以是由運算數及算子組成的運算式。

在上述的運算式中,(3 + 5)是乘法的第一個運算數,而2是第二個運算數。 運算數(3 + 5)本身也是運算式,其中包括算子加號,以及二個運算數3和5。

運算順序

[编辑]

算子運算的順序會影響運算的結果[2]

上述算式中,乘法會在加法前先計算,乘法的運算數分別為5和2,而加法的運算數分別為3和5 × 2。

運算數和算子的對應位置

[编辑]

數學運算有不同的表示法,運算數和算子的對應位置也有所不同。其中最常用的是中缀表示法,二元算子會放在二個運算數的中間[3],不過也有其他的表示法,像是前綴表示法(也稱為波蘭表示法)及逆波兰表示法(也稱為逆波蘭表示法),這種表示法較常在計算機科學中出現。

以下是不同表示法的比較,都是表示1和2相加:

中缀表示法
前綴表示法
後綴表示法

較複雜的例子如:

中缀表示法
前綴表示法
後綴表示法

以上三個式子皆代表10先除以二,與1相加後再取絕對值。其中,表示一數的絕對值。

中缀表示法及運算次序

[编辑]

前綴表示法和後綴表示法中不需處理運算次序的問題,但中缀表示法需考慮到各算子的運算次序,可以用以下的英文句子助憶:

Please excuse my dear Aunt Sally.[4]

其中單字的第一個字母表示以下的詞:

p = 括弧(parentheses)
e = 幂次(exponents)
m = 乘法(multiplication)
d = 除法(division)
a = 加法(addition)
s = 減法(subtraction)

在數學運算中,運算順序是從左到右,由最左側開始,找到需最先計算的算子,進行計算,再計算第二重要的算子……,例如以下的運算式:

,

第一個要處理的是括弧內的運算式,此處括弧內的運算式只有(2 + 22),在括弧內要最先計算的算式為22,其數值為4,在計算後,剩下的運算式為:

接下來要處理的仍是括弧內的運算式,此處括弧內的運算式為(2 + 4) = 6,因此剩下的運算式為:

在計算完括弧內的運算式後,繼續從左到右找最先要計算的運算式,接下來要最先計算的運算式為幂次,對應的算式為22,其數值為4,因此剩下的算式為

.

接下來要計算的是乘法,,因此算式變成

依運算順序,要考慮的是除法,不過沒有除法,再來要考慮的加法也沒有出現,因此要處理的是減法

.

因此算式4 × 22 − (2 + 22)的結果為10。

在中缀表示法中,運算順序非常重要,若運算順序錯誤,可能會算到錯誤的數值,只有每個運算都依正確的運算順序計算,才會有正確的結果。

元数

[编辑]

算子需要運算數(運算元)的個數稱為元数[5]。算子可以依元数分為一元運算(一個運算元)、二元运算(二個運算元)及三元運算(三個運算元)等。

參考資料

[编辑]
  1. ^ Soukhanov, A.H. The American Heritage Dictionary of the English Language. Houghton Mifflin. 1992. ISBN 9780395448953. LCCN 92000851. 
  2. ^ Physical Review Style and Notation Guide (PDF). American Physical Society. Section IV–E–2–e. [5 August 2012]. (原始内容 (PDF)存档于2013-04-20). 
  3. ^ The Implementation and Power of Programming Languages. [30 August 2014]. (原始内容存档于2014-09-24). 
  4. ^ McKellar, Danica. Kiss My Math: Showing Pre-Algebra Who's Boss. New York: Plume. 2009. ISBN 9780452295407. 
  5. ^ Michiel Hazewinkel. Encyclopaedia of Mathematics, Supplement III. Springer. 2001: 3 [2015-07-18]. ISBN 978-1-4020-0198-7. (原始内容存档于2021-04-27). 
{{bottomLinkPreText}} {{bottomLinkText}}
運算數
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?