Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Operand
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Notation== ===Expressions as operands=== Operands may be nested, and may consist of expressions also made up of operators with operands. :<math>(3 + 5) \times 2</math> In the above expression '(3 + 5)' is the first operand for the multiplication operator and '2' the second. The operand '(3 + 5)' is an expression in itself, which contains an addition operator, with the operands '3' and '5'. ===Γ=== [[Order of operations|Rules of precedence]] affect which values form operands for which operators:<ref>{{Cite web|url=https://publish.aps.org/files/styleguide-pr.pdf |title=Physical Review Style and Notation Guide |publisher=[[American Physical Society]]|access-date=5 August 2012|at=Section IV–E–2–e}}</ref> :<math>3 + 5 \times 2</math> In the above expression, the multiplication operator has the higher precedence than the addition operator, so the multiplication operator has operands of '5' and '2'. The addition operator has operands of '3' and '5 Γ 2'. ===Positioning of operands=== Depending on the [[mathematical notation]] being used the position of an operator in relation to its operand(s) may vary. In everyday usage [[infix notation]] is the most common,<ref name="Infix, Postfix and Prefix">{{cite web | url=http://www.cs.man.ac.uk/~pjj/cs212/fix.html | title=The Implementation and Power of Programming Languages | access-date=30 August 2014}}</ref> however other notations also exist, such as the [[prefix notation|prefix]] and [[postfix notation|postfix]] notations. These alternate notations are most common within [[computer science]]. Below is a comparison of three different notations β all represent an addition of the numbers '1' and '2' :<math>1 + 2</math> (infix notation) :<math>+\;1\;2</math> (prefix notation) :<math>1\;2\;+</math> (postfix notation) ===Infix and the order of operation=== {{main|Order of operations}} In a mathematical expression, the order of operation is carried out from left to right. Start with the leftmost value and seek the first operation to be carried out in accordance with the order specified above (i.e., start with parentheses and end with the addition/subtraction group). For example, in the expression :<math>4 \times 2^2 - (2 + 2^2)</math>, the first operation to be acted upon is any and all expressions found inside a parenthesis. So beginning at the left and moving to the right, find the first (and in this case, the only) parenthesis, that is, (2 + 2<sup>2</sup>). Within the parenthesis itself is found the expression 2<sup>2</sup>. The reader is required to find the value of 2<sup>2</sup> before going any further. The value of 2<sup>2</sup> is 4. Having found this value, the remaining expression looks like this: :<math>4 \times 2^2 - (2 + 4)</math> The next step is to calculate the value of expression inside the parenthesis itself, that is, (2 + 4) = 6. Our expression now looks like this: :<math>4 \times 2^2 - 6</math> Having calculated the parenthetical part of the expression, we start over again beginning with the left most value and move right. The next order of operation (according to the rules) is exponents. Start at the left most value, that is, 4, and scan your eyes to the right and search for the first exponent you come across. The first (and only) expression we come across that is expressed with an exponent is 2<sup>2</sup>. We find the value of 2<sup>2</sup>, which is 4. What we have left is the expression :<math>4 \times 4 - 6</math>. The next order of operation is multiplication. 4 Γ 4 is 16. Now our expression looks like this: :<math>16 - 6</math> The next order of operation according to the rules is division. However, there is no division operator sign (Γ·) in the expression, 16 β 6. So we move on to the next order of operation, i.e., addition and subtraction, which have the same precedence and are done left to right. :<math>16 - 6 = 10</math>. So the correct value for our original expression, 4 Γ 2<sup>2</sup> β (2 + 2<sup>2</sup>), is 10. It is important to carry out the order of operation in accordance with rules set by convention. If the reader evaluates an expression but does not follow the correct order of operation, the reader will come forth with a different value. The different value will be the incorrect value because the order of operation was not followed. The reader will arrive at the correct value for the expression if and only if each operation is carried out in the proper order. ===Arity=== The number of operands of an operator is called its [[arity]].<ref name="Hazewinkel2001">{{cite book|author=Michiel Hazewinkel|author-link=Michiel Hazewinkel|title=Encyclopaedia of Mathematics, Supplement III|url=https://books.google.com/books?id=47YC2h295JUC&pg=PA3|year=2001|publisher=Springer|isbn=978-1-4020-0198-7|page=3}}: "Each connective has associated with it a natural number, called its ''rank'', or ''arity''."</ref> Based on arity, operators are chiefly classified as nullary (no operands), [[unary operation|unary]] (1 operand), [[binary operation|binary]] (2 operands), [[ternary operation|ternary]] (3 operands). Higher arities are less frequently denominated through a specific terms, all the more when function composition or [[currying]] can be used to avoid them. Other terms include: {{div col}} * quaternary, tetranary (4) * quinary, quintenary, quinquennary (5) * hexanary, senary, sexenary (6) * septenary (7) * octonary (8) * nonary, novenary (9) * denary (10) * undenary (11) * duodenary (12) * tridecennary (13) * quindenary (15) * vigenary (20) * quadringenary (40) * quinquagenary (50) * sexagenary (60) * septuagenary (70) * octogenary (80) * nonagenary (90) * centenary (100) * sesquicentenary (150) * bicentenary (200) * tercentenary, tricentenary (300) * quadringentenary, quatercentenary (400) * quincentenary (500) * sexcentenary (600) * septcentenary (700) * octocentenary (800) {{div col end}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)