Urutan operasi: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
Tidak ada ringkasan suntingan
InternetArchiveBot (bicara | kontrib)
Reformat 1 URL (Wayback Medic 2.5)) #IABot (v2.0.9.5) (GreenC bot
 
(7 revisi perantara oleh 6 pengguna tidak ditampilkan)
Baris 3:
For example, in mathematics and most computer languages multiplication is done before addition; in the expression 2 + 3 × 4, the answer is 14. Brackets, "( and ), { and }, or [ and ]", which have their own rules, may be used to avoid confusion, thus the preceding expression may also be rendered 2 + (3 × 4), but the brackets are unnecessary as multiplication still has precedence without them.
 
Since the introduction of modern algebraic notation, multiplication has taken precedence over addition.<ref>{{Cite web|url=http://mathforum.org/library/drmath/view/52582.html |title=Ask Dr. Math |publisher=Math Forum |date=22 November 2000 |accessdate=5 March 2012}}</ref> Thus 3&nbsp;+&nbsp;4&nbsp;&times;×&nbsp;5 =&nbsp;4&nbsp;&times;×&nbsp;5&nbsp;+&nbsp;3 = 23. When exponents were first introduced in the 16th and 17th centuries, exponents took precedence over both addition and multiplication and could be placed only as a superscript to the right of their base. Thus 3&nbsp;+&nbsp;5<sup>2</sup> = 28 and 3&nbsp;&times;×&nbsp;5<sup>2</sup> =&nbsp;75. To change the order of operations, originally a [[vinculum (symbol)|vinculum]] (an overline or underline) was used. Today, [[bracket (mathematics)|parentheses or brackets]] are used to explicitly denote precedence by grouping parts of an expression that should be evaluated first. Thus, to force addition to precede multiplication, we write (2&nbsp;+&nbsp;3)&nbsp;&times;×&nbsp;4 =&nbsp;20, and to force addition to precede exponentiation, we write (3&nbsp;+&nbsp;5)<sup>2</sup> = 64.
-->
== Urutan operasi standar ==
 
Urutan operasi yang digunakan dalam [[matematika]], [[sains]], [[teknologi]] dan banyak [[bahasa pemrograman]] [[komputer]] didaftarkan di sini :<ref>{{Cite web|url=http://www.algebrahelp.com/lessons/simplifying/oops/ |title=Order of Operations Lessons |publisher=Algebra.Help |date= |accessdate=5 March 2012}}</ref>
 
: '''[[eksponen]]''' dan '''[[:en:Nth root|akar]]'''
: '''[[perkalian]]''' dan '''[[pembagian]]'''
: '''[[penjumlahan]]''' dan '''[[pengurangan]]'''
<!--
Baris 23:
Symbols of grouping can be used to override the usual order of operations. Grouped symbols can be treated as a single expression. Symbols of grouping can be removed using the associative and distributive laws, also they can be removed if the expression inside the symbol of grouping is sufficiently simplified so no ambiguity results from their removal.
-->
=== Contoh ===
 
: <math>\sqrt{1+3}+5=\sqrt4+5=2+5=7.\,</math>
Baris 31:
: <math>\frac{1+2}{3+4}+5=\frac37+5.</math>
 
Untuk memudahkan pembacaan, simbol kelompok yang lain, seperti [[tanda kurung]], seringkalisering kali disebut "tanda kurung melengkung" ( ), atau tanda kurung himpunan (''curly braces'') { }, atau tanda kurung siku (''square brackets'') [ ], seringkalisering kali digunakan bergantian. Misalnya,
 
: <math>[(1+2)-3]-(4-5) = [3-3]-(-1) = 1. \, </math>
Baris 37:
===Exceptions to the standard===
 
There exist differing conventions concerning the unary operator − (usually read "minus"). In written or printed mathematics, the expression &minus;3−3<sup>2</sup> is interpreted to mean &minus;(3<sup>2</sup>)&nbsp;=&nbsp;&minus;9−9,<ref>Allen R. Angel, Elementary Algebra for College Students 8/E; Chapter 1, Section 9, Objective 3</ref> but in some applications and programming languages, notably the [[BASIC language|BASIC programming language]], the application [[Microsoft Office Excel]] and [[bc programming language|the programming language bc]], unary operators have a higher priority than binary operators, that is, the unary minus (negation) has higher precedence than exponentiation, so in those languages &minus;3−3<sup>2</sup> will be interpreted as (&minus;3−3)<sup>2</sup>&nbsp;=&nbsp;9.<ref>{{Cite web|url=http://support.microsoft.com/kb/q132686/ |title=Formula Returns Unexpected Positive Value |publisher=Support.microsoft.com |date=15 August 2005 |accessdate=5 March 2012}}</ref> Note this does not apply to the binary operator −; for example while the formulas <code>=-2^2</code> and <code>=0+-2^2</code> return 4 in Microsoft Excel, the formula <code>=0-2^2</code> returns −4. In cases where there is the possibility that the notation might be misinterpreted, parentheses are usually used to clarify the intended meaning.
 
Similarly, there can be ambiguity in the use of the [[Slash (punctuation)#Arithmetic|slash]] ('/') symbol in expressions such as 1/2''x''. If one rewrites this expression as 1 ÷ 2 &times;× ''x'' and then interprets the division symbol as indicating multiplication by the reciprocal, this becomes
: <math>1 \div 2 \times x = 1 \times \tfrac{1}{2} \times x = \tfrac{1}{2}x.</math>
Hence, with this interpretation we have that 1/2''x'' is equal to (1/2)''x'', and not 1/(2''x''). However, there are examples, including in published literature, where implied multiplication is interpreted as having higher precedence than division, so that 1/2''x'' equals 1/(2''x''), not (1/2)''x''. For example, the manuscript submission instructions for the ''[[Physical Review]]'' journals state that multiplication is of higher precedence than division with a slash,<ref>{{Cite web|url=https://publish.aps.org/files/styleguide-pr.pdf |title=Physical Review Style and Notation Guide |publisher=[[American Physical Society]]|accessdate=5 August 2012|at=Section IV&ndash;E&ndash;2&ndash;eIV–E–2–e}}</ref> and this is also the convention observed in prominent physics textbooks such as the ''[[Course of Theoretical Physics]]'' by [[Lev Landau|Landau]] and [[Evgeny Lifshitz|Lifshitz]] and the ''[[Feynman Lectures on Physics]]''.<ref>For example, the third edition of ''Mechanics'' by Landau and Lifshitz contains expressions such as ''hP<sub>z</sub>''/2π (p. 22), and the first volume of the ''Feynman Lectures'' contains expressions such as 1/2{{sqrt|''N''}} (p. 6&ndash;86–8). In both books these expressions are written with the convention that the solidus is evaluated last.</ref> [[Wolfram Alpha]] changed in early 2013 to treat implied multiplication the same as explicit multiplication (formerly, implied multiplication without parentheses was assumed to bind more strongly than explicit multiplication). 2''x''/2''x'', 2*''x''/2*''x'', and 2(x)/2(x) now all yield x<sup>2</sup>.<ref>{{Cite web|url=http://www.wolframalpha.com/input/?i=2x%2F2x%2C+2*x%2F2*x%2C+2%28x%29%2F2%28x%29+|title=2x&#x2f;/2x, 2&#x2a;*x&#x2f;/2&#x2a;*x, 2&#x28;(x&#x29;&#x2f;)/2&#x28;(x&#x29;) - Wolfram&#124;Alpha|publisher=Wolframalpha.com |date= |accessdate=11 February 2013}}</ref> Newer TI calculators (TI 83 or later) also yield ''x''<sup>2</sup> in all three cases.
 
==Mnemonik==
Baris 98:
| publisher = Texas Instruments Incorporated
| date = 23 Apr 2013
| url = httphttps://archive.istoday/20130204120803/http://epsstore.ti.com/OA_HTML/csksxvm.jsp?nSetId=103110
| accessdate = 10 May 2013}}</ref> as well as by all HP with algebraic notation. While the first interpretation may be expected by some users, only the latter is in agreement with the standard rule that multiplication and division are of equal precedence,{{citation needed|date=May 2013}} so 1/2''x'' is read one divided by two and the answer multiplied by ''x''.
 
Baris 114:
 
{| class="wikitable"
|1 || () &nbsp; [] &nbsp; -> &nbsp; . &nbsp; :: || Function call, scope, array/member access
|-
|2 || ! &nbsp; ~ &nbsp; - &nbsp; + &nbsp; * &nbsp; & &nbsp; sizeof &nbsp; ''type cast'' ++x &nbsp; --x &nbsp; || (most) unary operations, sizeof and type casts
|-
|3 || * &nbsp; / &nbsp; % MOD || Multiplication, division, [[modularAritmetika arithmeticmodular|modulo]]
|-
|4 || + &nbsp; - || Addition and subtraction
Baris 152:
[[Source-to-source compiler]]s that compile to multiple languages need to explicitly deal with the issue of different order of operations across languages. [[Haxe]] for example standardizes the order and enforces it by inserting brackets where it is appropriate.<ref>[http://blog.onthewings.net/2011/05/02/six-divided-by-two-bracket-one-plus-two/ 6÷2(1+2)=?] Andy Li's Blog. 2 May 2011. Retrieved 31 December 2012.</ref>
 
The accuracy of software developer knowledge about binary operator precedence has been found to closely follow their frequency of occurrence in source code.<ref>"[http://www.knosof.co.uk/cbook/accu06.html Developer beliefs about binary operator precedence]" Derek M. Jones, CVu 18(4):14&ndash;2114–21</ref>
-->
== Lihat pula ==
* [[Associativity]]
* [[Common operator notation]] (for a more formal description)
Baris 166:
* [[Reverse Polish notation]]
 
== Referensi ==
<references/>
 
== Pranala luar ==
* {{planetmathen}} reference{{PlanetMath|id=3951orderofoperations|title=Orderorder of operations (ID: urutan operasi)}}
 
{{Use dmy dates|date=June 2011}}
 
{{DEFAULTSORT:Urutan operasi}}
[[CategoryKategori:Aljabar]]
[[CategoryKategori:Mnemonik]]
[[CategoryKategori:Operators (programming)]]