Debian Codegraph @

opcodes/adds.xml

raw symbols SCIP
1
2 <refentry id="adds">
3 <indexterm id="IndexPlus"><primary>&plus;</primary></indexterm>
4 <refentryinfo><title>Mathematical Operations:Arithmetic and Logic Operations</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>&plus;</refentrytitle>
7 </refmeta>
8
9
10
11 <refnamediv>
12 <refname>&plus;</refname>
13
14 <refpurpose>
15 Addition operator
16 </refpurpose>
17 </refnamediv>
18
19 <refsect1>
20 <title>Description</title>
21 <para>
22 Arithmetic operators perform operations of change-sign (negate), do-no-change-sign, logical AND logical OR, add, subtract, multiply and divide. Note that a value or an expression may fall between two of these operators, either of which could take it as its left or right argument, as in
23 <literallayout>
24 a + b * c.
25 </literallayout>
26 </para>
27
28 <para>
29 In such cases three rules apply:
30 </para>
31
32 <para>
33 1. &ast; and <emphasis>&sol;</emphasis> bind to their neighbors more strongly than &plus; and &minus;. Thus the above expression is taken as
34 <literallayout>
35 a + (b * c)
36 </literallayout>
37 with &ast; taking b and c and then &plus; taking a and b &ast; c.
38 </para>
39
40 <para>
41 2. <emphasis>&plus;</emphasis> and <emphasis>&minus;</emphasis>
42 bind more strongly than &amp;&amp;, which in turn is stronger
43 than &verbar;&verbar;:
44 <literallayout>
45 a &amp;&amp; b - c &verbar;&verbar; d
46 </literallayout>
47 is taken as
48 <literallayout>
49 (a &amp;&amp; (b - c)) &verbar;&verbar; d
50 </literallayout>
51 </para>
52
53 <para>
54 3. When both operators bind equally strongly, the operations are done left to right:
55 <literallayout>
56 a - b - c
57 </literallayout>
58 is taken as
59 <literallayout>
60 (a - b) - c
61 </literallayout>
62 </para>
63
64 <para>
65 Parentheses may be used as above to force particular groupings.
66 </para>
67 </refsect1>
68
69 <refsect1>
70 <title>Syntax</title>
71 <synopsis><command>&plus;</command>a (no rate restriction)</synopsis>
72 <synopsis>a <command>&plus;</command> b (no rate restriction)</synopsis>
73
74 <para>
75 where the arguments <emphasis>a</emphasis> and <emphasis>b</emphasis> may be further expressions.
76 </para>
77 </refsect1>
78
79 <refsect1>
80 <title>Arguments</title>
81 <para>
82 The arguments of &plus; can be scalar values or k-rate one
83 dimensional arrays (vectors), or any combination. If one of the
84 arguments is an array, so is the value.
85 </para>
86 </refsect1>
87
88 <refsect1>
89 <title>Examples</title>
90 <para>
91 Here is an example of the &plus; operator. It uses the file <ulink url="examples/adds.csd"><citetitle>adds.csd</citetitle></ulink>.
92
93 <example>
94 <title>Example of the &plus; operator.</title>
95
96
97
98 <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para>
99 <xi:include href="examples-xml/adds.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
100 </example>
101 </para>
102 </refsect1>
103
104 <refsect1>
105 <title>See also</title>
106 <para><link linkend="MathArtLogic"><citetitle>Arithmetic and Logic Operations</citetitle></link></para>
107 </refsect1>
108
109 <refsect1>
110 <title>Credits</title>
111 <para>Arithmetic on vectors is new in version 6.00</para>
112 </refsect1>
113
114 </refentry>