HOME

TheInfoList



OR:

In
mathematics Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, an operand is the object of a
mathematical operation In mathematics, an operation is a Function (mathematics), function which takes zero or more input values (also called "''operands''" or "arguments") to a well-defined output value. The number of operands is the arity of the operation. The most c ...
, i.e., it is the object or quantity that is operated on.


Example

The following
arithmetic Arithmetic () is an elementary part of mathematics that consists of the study of the properties of the traditional operations on numbers— addition, subtraction, multiplication, division, exponentiation, and extraction of roots. In the 19th ...
expression shows an example of operators and operands: :3 + 6 = 9 In the above example, '+' is the symbol for the operation called
addition Addition (usually signified by the Plus and minus signs#Plus sign, plus symbol ) is one of the four basic Operation (mathematics), operations of arithmetic, the other three being subtraction, multiplication and Division (mathematics), division. ...
. The operand '3' is one of the inputs (quantities) followed by the addition 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 augend 3 and the addend 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. :(3 + 5) \times 2 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: :3 + 5 \times 2 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 Mathematical notation consists of using symbols for representing operations, unspecified numbers, relations and any other mathematical objects, and assembling them into expressions and formulas. Mathematical notation is widely used in mathematic ...
being used the position of an operator in relation to its operand(s) may vary. In everyday usage
infix notation Infix notation is the notation commonly used in arithmetical and logical formulae and statements. It is characterized by the placement of operators between operands—" infixed operators"—such as the plus sign in . Usage Binary relations a ...
is the most common, however other notations also exist, such as the
prefix A prefix is an affix which is placed before the Word stem, stem of a word. Adding it to the beginning of one word changes it into another word. For example, when the prefix ''un-'' is added to the word ''happy'', it creates the word ''unhappy'' ...
and postfix notations. These alternate notations are most common within
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to Applied science, practical discipli ...
. Below is a comparison of three different notations — all represent an addition of the numbers '1' and '2' :1 + 2 (infix notation) :+\;1\;2 (prefix notation) :1\;2\;+ (postfix notation)


Infix and the order of operation

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 :4 \times 2^2 - (2 + 2^2), 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 + 22). Within the parenthesis itself is found the expression 22. The reader is required to find the value of 22 before going any further. The value of 22 is 4. Having found this value, the remaining expression looks like this: :4 \times 2^2 - (2 + 4) 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: :4 \times 2^2 - 6 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 22. We find the value of 22, which is 4. What we have left is the expression :4 \times 4 - 6. The next order of operation is multiplication. 4 × 4 is 16. Now our expression looks like this: :16 - 6 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. :16 - 6 = 10. So the correct value for our original expression, 4 × 22 − (2 + 22), 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 Arity () is the number of arguments or operands taken by a function, operation or relation in logic, mathematics, and computer science. In mathematics, arity may also be named ''rank'', but this word can have many other meanings in mathematics. In ...
.: "Each connective has associated with it a natural number, called its ''rank'', or ''arity''." Based on arity, operators are chiefly classified as nullary (no operands), unary (1 operand),
binary Binary may refer to: Science and technology Mathematics * Binary number, a representation of numbers using only two digits (0 and 1) * Binary function, a function that takes two arguments * Binary operation, a mathematical operation that ta ...
(2 operands),
ternary Ternary (from Latin ''ternarius'') or trinary is an adjective meaning "composed of three items". It can refer to: Mathematics and logic * Ternary numeral system, a base-3 counting system ** Balanced ternary, a positional numeral system, useful ...
(3 operands). Higher arities are less frequently denominated through a specific terms, all the more when function composition or
currying In mathematics and computer science, currying is the technique of translating the evaluation of a function that takes multiple arguments into evaluating a sequence of functions, each with a single argument. For example, currying a function f that ...
can be used to avoid them. Other terms include: * 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)


Computer science

In computer
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
s, the definitions of 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, while 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 In computer programming, assembly language (or assembler language, or symbolic machine code), often referred to simply as Assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence be ...
, an operand is a value (an argument) on which the instruction, named by
mnemonic A mnemonic ( ) device, or memory device, is any learning technique that aids information retention or retrieval (remembering) in the human memory for better understanding. Mnemonics make use of elaborative encoding, retrieval cues, and imag ...
, operates. The operand may be a
processor register A processor register is a quickly accessible location available to a computer's processor. Registers usually consist of a small amount of fast storage, although some registers have specific hardware functions, and may be read-only or write-only. ...
, a
memory address In computing, a memory address is a reference to a specific memory location used at various levels by software and hardware. Memory addresses are fixed-length sequences of digits conventionally displayed and manipulated as unsigned integers. Su ...
, a literal constant, or a label. A simple example (in the
x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel based on the Intel 8086 microprocessor and its 8088 variant. The 8086 was introd ...
architecture) is MOV DS, AX where the value in register operand AX is to be moved ( MOV) into register DS. Depending on the instruction, there may be zero, one, two, or more operands.


See also

*
Instruction set In computer science, an instruction set architecture (ISA), also called computer architecture, is an abstract model of a computer. A device that executes instructions described by that ISA, such as a central processing unit (CPU), is called an ' ...
*
Opcode In computing, an opcode (abbreviated from operation code, also known as instruction machine code, instruction code, instruction syllable, instruction parcel or opstring) is the portion of a machine language instruction that specifies the operat ...


References

{{Reflist Algebra Mathematical notation Operators (programming) Machine code