UNPKG

epubjs

Version:

Render ePub documents in the browser, across many devices

132 lines (127 loc) 4.68 kB
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta charset="utf-8"/> <title>Getting Started with Processing</title> <script type="text/javascript"> if(!window.atlasplugins) window.atlasplugins = {} atlasplugins.codeMirrorSettings = { theme: "3024-day" } </script> <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700" rel="stylesheet" type="text/css"> </link> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"> </script> <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script> <link rel="stylesheet" type="text/css" href="theme/html/html.css"/> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/4.4.0/codemirror.min.css"/> <link rel="stylesheet" type="text/css" href="https://d2uogd9jz9k9zm.cloudfront.net/processingjs-0.0.3.css"/> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js" type="text/javascript"> </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/4.4.0/codemirror.min.js" type="text/javascript"> </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/4.5.0/mode/clike/clike.min.js" type="text/javascript"> </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js" type="text/javascript"> </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.8/processing.min.js" type="text/javascript"> </script> <script src="https://d2uogd9jz9k9zm.cloudfront.net/processingjs-0.0.3.min.js" type="text/javascript"> </script> <script type="text/javascript"> $(function() { // Make all non runnable examples readonly codemirrors $('pre:not(*[data-executable], .CodeMirror pre)').each(function(i, el) { var textArea = $('<textarea>' + el.innerHTML + '</textarea>') $(el).replaceWith(textArea); var editor = CodeMirror.fromTextArea(textArea[0], { mode: "text/x-java", theme: "3024-day", readOnly: true, viewportMargin: 0 }); }); }); </script> <style type="text/css"> /* This needs to come last to set auto height, and html.css is always included first */ .CodeMirror { height: auto; font-size: 14px; padding: 15px; border-radius: 5px; } .CodeMirror-scroll { overflow-y: hidden; overflow-x: auto; height: auto; } </style> <script type="text/javascript" src="theme/html/epub.js"> </script> <script type="text/javascript" src="theme/html/reader.js"> </script> </head> <body data-type="book" id="viewer"> <section data-type="appendix" data-pdf-bookmark="Appendix C. Order of Operations" id="order_of_operations"> <h1>Order of Operations</h1> <p>When mathematical calculations are performed in a program, each operation takes place according to a prespecified order. This <em>order of operations</em> ensures that the code is run the same way every time. This is no different from arithmetic or algebra, but programming has other operators that are less familiar.</p> <p>In the following table, the operators on the top are run before those below. Therefore, an operation inside parentheses will run first and an assignment will run last.</p> <table> <thead> <tr> <th>Name</th> <th>Symbol</th> <th>Examples</th> </tr> </thead> <tbody> <tr> <td><p>Parentheses</p></td> <td><p>()</p></td> <td><p><code>a \* (b + c)</code></p></td> </tr> <tr> <td><p>Postfix, Unary</p></td> <td><p>++ −− !</p></td> <td><p><code>a++ −−b !c</code></p></td> </tr> <tr> <td><p>Multiplicative</p></td> <td><p>* / %</p></td> <td><p><code>a \* b</code></p></td> </tr> <tr> <td><p>Additive</p></td> <td><p>+ −</p></td> <td><p><code>a + b</code></p></td> </tr> <tr> <td><p>Relational</p></td> <td><p>&gt; &lt; &lt;= &gt;=</p></td> <td><p><code>if (a &gt; b)</code></p></td> </tr> <tr> <td><p>Equality</p></td> <td><p>== !=</p></td> <td><p><code>if (a == b)</code></p></td> </tr> <tr> <td><p>Logical AND</p></td> <td><p>&amp;&amp;</p></td> <td><p><code>if (mousePressed &amp;&amp; (a &gt; b))</code></p></td> </tr> <tr> <td><p>Logical OR</p></td> <td/> <td/> </tr> <tr> <td/> <td><p>+if (mousePressed</p></td> <td/> </tr> <tr> <td><p>(a &gt; b))+</p></td> <td><p>Assignment</p></td> <td><p>= += −= *= /= %=</p></td> </tr> </tbody> </table> </section> </body> </html>