Urutan operasi: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
k Bot: Perubahan kosmetika |
Reformat 1 URL (Wayback Medic 2.5)) #IABot (v2.0.9.5) (GreenC bot |
||
(6 revisi perantara oleh 5 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 + 4
-->
== Urutan operasi standar ==
Urutan operasi yang digunakan dalam [[matematika]], [[sains]], [[teknologi]] dan banyak [[bahasa pemrograman]] [[komputer]] didaftarkan di sini
: '''[[eksponen]]''' dan '''[[:en:Nth root|akar]]'''
Baris 31:
: <math>\frac{1+2}{3+4}+5=\frac37+5.</math>
Untuk memudahkan pembacaan, simbol kelompok yang lain, seperti [[tanda kurung]],
: <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
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
: <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
==Mnemonik==
Baris 98:
| publisher = Texas Instruments Incorporated
| date = 23 Apr 2013
| url =
| 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 || () [] -> .
|-
|2 || ! ~ - + * & sizeof ''type cast'' ++x --x || (most) unary operations, sizeof and type casts
|-
|3 || * / % MOD || Multiplication, division, [[
|-
|4 || + - || 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):
-->
== Lihat pula ==
Baris 170:
== Pranala luar ==
* {{
{{Use dmy dates|date=June 2011}}
|