ttcalc/help/operators_priority.html

37 lines
1.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>TTCalc - operators priority</title>
<link rel="stylesheet" href="styles.css" type="text/css">
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
<param name="Keyword" value="operators priority">
</object>
</head>
<body>
<h1>Operators Priority</h1>
<p>Below is a list of operators priority. At the top are operators with higher precedence.</p>
<table class="operatorspriority">
<thead>
<tr><td>Operator</td><td>Description</td><td>Sample</td></tr>
</thead>
<tr><td>( )</td><td>parentheses for grouping an expression</td><td>(1+3)*4</td></tr>
<tr><td>- + # &amp;</td><td>unary minus and plus, and operators for changing the base (radix)</td><td>-10<br>&1111 (bin)<br>#ff (hex)</td></tr>
<tr><td>%</td><td>percentage from a previous value</td><td>100-30%</td></tr>
<tr><td>^</td><td>powering</td><td>3^2</td></tr>
<tr><td>* /</td><td>multiplication and division</td><td>10*20</td></tr>
<tr><td>without an operator</td><td>short form of multiplication<br>(only if the second argument is a variable or function,<br>the same priority as a normal multiplication)</td><td>3y</td></tr>
<tr><td>+ -</td><td>addition and subtraction</td><td>10-30</td></tr>
<tr><td>== != &lt; &gt; &lt;= &gt;=</td><td>comparative operators</td><td>4&lt;5</td></tr>
<tr><td>&amp;&amp;</td><td>logical and</td><td>3&gt;2 &amp;&amp; 3&lt;10</td></tr>
<tr><td>||</td><td>logical or</td><td>3&gt;2 || 3&lt;10</td></tr>
</table>
</body>
</html>