Editing Add 0 You are not logged in. The rich text editor does not work with JavaScript switched off. Please either enable it in your browser options, or visit your preferences to switch to the old MediaWiki editor The '''add''' operator is an [[Arithmetic Operators|arithmetic operator]] which performs the sum of two [[Numbers|number]] objects. Its token is named '''ADDITION'''. == Phrases == === Infix === {{See Also/small|Infix notation}} Infix notation can be achieved using the phrases {{Code|operator|added to}}, {{Code|operator|plus}} or {{Code|operator|and}}. Its [[FDS]] is {{codeblock|{{tag|value|number}}{{tag|whitespace}}{{code|operator|[added to/plus/and]}}{{tag|whitespace}}{{tag|value|number}}}} ==== Example ==== {{codeblock|{{Code|keyword|I wrote}}{{Code|whitespace| }}{{Code|type|the number}}{{Code|whitespace| }}{{Code|literal|2}}{{Code|whitespace| }}{{Code|operator|added to}}{{Code|whitespace| }}{{Code|type|the number}}{{Code|whitespace| }}{{Code|literal|5}}{{Code|punctuation|.}}}} This [[Print|prints]] {{Code|literal|7}}. Java equivalent: {{Codeblock|<SOURCE LANG="java"> System.out.println((double)2 + (double)5); </SOURCE>}} === Prefix === {{See Also/small|Prefix notation}} Prefix notation can be achieved using the phrase {{Code|operator|add}} and the infix separator {{Code|operator|and}}. Its [[FDS]] is {{codeblock|{{Code|operator|add}}{{tag|whitespace}}{{tag|value|number}}{{tag|whitespace}}{{Code|operator|and}}{{tag|whitespace}}{{tag|value|number}}}} ==== Example ==== {{codeblock|{{Code|keyword|I wrote}}{{Code|whitespace| }}{{Code|operator|add}}{{Code|whitespace| }}{{Code|literal|2}}{{Code|whitespace| }}{{Code|operator|and}}{{Code|whitespace| }}{{Code|literal|5}}{{Code|punctuation|.}}}} {{output|7}} === Increment === {{Main/small|Increment}} The increment operator is a special case of addition, and adds the fixed value {{Code|literal|1}} to a '''variable''' and cannot be used on literals. This operator is a single instruction by itself. It can be achieved by using the phrase {{Code|operator|got one more}}. Its [[FDS]] is {{codeblock|{{Code|variable|<variable:'''number'''>}}{{Code|whitespace|<whitespace>}}{{Code|operator|got one more}}{{Code|punctuation|<punctuation>}}}} ==== Example ==== {{codeblock|{{Code|variable|Spike}}{{Code|whitespace| }}{{Code|operator|got one more}}{{Code|punctuation|.}}}} This adds {{Code|literal|1}} to the variable {{Code|variable|Spike}}. Java equivalent: {{Codeblock|<SOURCE LANG=java>Spike++;</SOURCE>}} {{Navbox/Phrases}} {{stub}} Loading editor Below are some commonly used wiki markup codes. Simply click on what you want to use and it will appear in the edit box above. Insert: – — … ° ≈ ≠ ≤ ≥ ± − × ÷ ← → · § Sign your username: ~~~~ Wiki markup: {{}} | [] [[]] [[Category:]] #REDIRECT [[]] <s></s> <sup></sup> <sub></sub> <code></code> <blockquote></blockquote> <ref></ref> {{Reflist}} <references/> <includeonly></includeonly> <noinclude></noinclude> {{DEFAULTSORT:}} <nowiki></nowiki> <!-- --> <span class="plainlinks"></span> Symbols: ~ | ¡ ¿ † ‡ ↔ ↑ ↓ • ¶ # ¹ ² ³ ½ ⅓ ⅔ ¼ ¾ ⅛ ⅜ ⅝ ⅞ ∞ ‘ “ ’ ” «» ¤ ₳ ฿ ₵ ¢ ₡ ₢ $ ₫ ₯ € ₠ ₣ ƒ ₴ ₭ ₤ ℳ ₥ ₦ № ₧ ₰ £ ៛ ₨ ₪ ৳ ₮ ₩ ¥ ♠ ♣ ♥ ♦ View this template This field is a spam trap. DO NOT fill it in! Edit summary Preview Mobile Desktop Show changes