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
Order of operations
(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!
{{short description|Performing order of mathematical operations}} {{distinguish|Operations order}} [[File:Order of operations.svg|thumb|'''Order of operations''']] {{use dmy dates|date=February 2015|cs1-dates=y}} {{use list-defined references|date=January 2022}} In [[mathematics]] and [[computer programming]], the '''order of operations''' is a collection of rules that reflect conventions about which operations to perform first in order to evaluate a given [[mathematical expression]]. These rules are formalized with a ranking of the operations. The rank of an operation is called its '''precedence''', and an operation with a ''higher'' precedence is performed before operations with ''lower'' precedence. [[Calculator]]s generally perform operations with the same precedence from left to right,{{r|Microsoft}} but some [[programming language]]s and calculators adopt different conventions. For example, multiplication is granted a higher precedence than addition, and it has been this way since the introduction of modern [[mathematical notation|algebraic notation]].{{r|BS}}{{r|Peterson}} Thus, in the expression {{nowrap|1 + 2 Γ 3}}, the multiplication is performed before addition, and the expression has the value {{nowrap|1 + (2 Γ 3) {{=}} 7}}, and not {{nowrap|(1 + 2) Γ 3 {{=}} 9}}. When exponents were introduced in the 16th and 17th centuries, they were given precedence over both addition and multiplication and placed as a superscript to the right of their base.{{r|BS}} Thus {{nowrap|3 + 5<sup>2</sup> {{=}} 28}} and {{nowrap|3 Γ 5<sup>2</sup> {{=}} 75}}. These conventions exist to avoid notational [[ambiguity]] while allowing notation to remain brief.{{r|Swokowski}} Where it is desired to override the precedence conventions, or even simply to emphasize them, [[Bracket#Parentheses|parentheses]] ( ) can be used. For example, {{nowrap|(2 + 3) Γ 4 {{=}} 20}} forces addition to precede multiplication, while {{nowrap|(3 + 5)<sup>2</sup> {{=}} 64}} forces addition to precede [[exponentiation]]. If multiple pairs of parentheses are required in a mathematical expression (such as in the case of nested parentheses), the parentheses may be replaced by other types of [[bracket]]s to avoid confusion, as in {{nowrap|[2 Γ (3 + 4)] β 5 {{=}} 9}}. These rules are meaningful only when the usual notation (called [[infix notation]]) is used. When [[functional notation|functional]] or [[Polish notation]] are used for all operations, the order of operations results from the notation itself.
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)