|
|
Line 1: |
Line 1: |
| {{Refimprove|date=November 2008}}
| | Hi there. Allow me start by introducing the author, her name is Myrtle Cleary. To gather cash is what his family and him enjoy. My family lives in Minnesota and my family members loves it. She is a librarian but she's usually wanted her personal business.<br><br>Take a look at my web site - [http://Xsl.cz/diettogoreviews74620 Xsl.cz] |
| | |
| In [[mathematic]]s, an '''operand''' is the object of a [[mathematical operation]], a quantity on which an operation is performed.<ref>American Heritage Dictionary</ref>
| |
| | |
| ==Example ==
| |
| The following [[arithmetic]] expression shows an example of operators and operands:
| |
| | |
| :<math>3 + 6 = 9\;</math>
| |
| | |
| In the above example, '+' is the symbol for the operation called [[addition]].
| |
| | |
| The '''operand''' '3' is one of the inputs (quantities) followed by the addition [[Operator_(mathematics)|operator]], and the operand '6' is the other input necessary for the operation.
| |
| | |
| The result of the operation is 9. (The number '9' is also called the sum of the addends, 3 and 6.)
| |
| | |
| An operand, then, is also referred to as "one of the inputs (quantities) for an operation".
| |
| | |
| ==Notation==
| |
| | |
| ===Expressions as operands===
| |
| Operands may be complex, 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:
| |
| | |
| :<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, 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 Notation and the Order of Operation===
| |
| {{main|Order of operations}}
| |
| | |
| With infix notation, one easy mnemonic for remembering the order of operation is:
| |
| | |
| '''P'''lease '''e'''xcuse '''m'''y '''d'''ear '''A'''unt '''S'''ally.
| |
| | |
| The first letter (in '''boldtype''') of each word in the above mnemonic stands for the following:
| |
| | |
| :'''p''' = parentheses
| |
| :'''e''' = exponents
| |
| :'''m''' = multiplication
| |
| :'''d''' = division
| |
| :'''a''' = addition
| |
| :'''s''' = subtraction
| |
| | |
| In a mathematical expression, the order of operation is carried out from left to right. Start with the left most 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 subtraction{{dubious|Correctness of PEMDAS explanation|reason=MD and AS need to be grouped together|date=May 2013}}). 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. But there is no addition operator sign (+) in the expression 16 − 6. So we move on to the next and final order of operation, which is subtraction.
| |
| | |
| :<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]]. Based on arity, operators are classified as nullary (no operands), [[unary operation|unary]] (1 operand), [[binary operation|binary]] (2 operands), [[ternary operation|ternary]] (3 operands) etc.
| |
| | |
| ==Computer science==
| |
| In computer [[programming language]]s, the definitions of [[operator (programming)|operator]] and '''operand''' are almost the same as in mathematics.
| |
| | |
| In computing, an '''operand''' is the part of a computer instruction which specifies what data is to be manipulated or operated on, whilst at the same time representing the data itself. A computer instruction describes an operation such as add or multiply X, while the operand (or operands, as there can be more than one) specify on which X to operate as well as the value of X.
| |
| | |
| Additionally, in [[assembly language]], an '''operand''' is a value (an argument) on which the [[instruction (computer science)|instruction]], named by [[mnemonic]], operates. The operand may be a [[processor register]], a [[memory address]], a literal constant, or a label. A simple example (in the [[x86]] architecture) is
| |
| | |
| :[[MOV (x86 instruction)|MOV]] DS, AX
| |
| | |
| where the value in register operand 'AX' is to be moved into register 'DS'. Depending on the [[instruction set|instruction]], there may be zero, one, two, or more operands.
| |
| | |
| ==See also==
| |
| {{portal|Mathematics}}
| |
| *[[Instruction_set#Number_of_operands|Instruction set]]
| |
| | |
| ==References==
| |
| {{Reflist}}
| |
| | |
| [[Category:Algebra]]
| |
| [[Category:Mathematical notation]]
| |
| [[Category:Operators (programming)]]
| |
| [[Category:Machine code]]
| |
Hi there. Allow me start by introducing the author, her name is Myrtle Cleary. To gather cash is what his family and him enjoy. My family lives in Minnesota and my family members loves it. She is a librarian but she's usually wanted her personal business.
Take a look at my web site - Xsl.cz