Debian Codegraph @

opcodes/divides.xml

raw symbols SCIP
1
2 <refentry id="divides">
3 <indexterm id="IndexSol"><primary>&sol;</primary></indexterm>
4 <refentryinfo><title>Mathematical Operations:Arithmetic and Logic Operations</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>&sol;</refentrytitle>
7 </refmeta>
8
9
10
11 <refnamediv>
12 <refname>&sol;</refname>
13
14 <refpurpose>
15 Division operator.
16 </refpurpose>
17 </refnamediv>
18
19 <refsect1>
20 <title>Description</title>
21 <para>
22 Arithmetic operators perform operations of change-sign (negate), don't-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> bind more strongly than &amp;&amp;, which in turn is stronger than &verbar;&verbar;:
42 <literallayout>
43 a &amp;&amp; b - c &verbar;&verbar; d
44 </literallayout>
45 is taken as
46 <literallayout>
47 (a &amp;&amp; (b - c)) &verbar;&verbar; d
48 </literallayout>
49 </para>
50
51 <para>
52 3. When both operators bind equally strongly, the operations are done left to right:
53 <literallayout>
54 a - b - c
55 </literallayout>
56 is taken as
57 <literallayout>
58 (a - b) - c
59 </literallayout>
60 </para>
61
62 <para>
63 Parentheses may be used as above to force particular groupings.
64 </para>
65 </refsect1>
66
67 <refsect1>
68 <title>Syntax</title>
69 <synopsis>a <command>&sol;</command> b (no rate restriction)</synopsis>
70
71 <para>
72 where the arguments <emphasis>a</emphasis> and <emphasis>b</emphasis> may be further expressions.
73 </para>
74 </refsect1>
75
76 <refsect1>
77 <title>Arguments</title>
78 <para>
79 The arguments of &sol; can be scalar values or k-rate one
80 dimensional arrays (vectors), or any combination. If one of the
81 arguments is an array, so is the value.
82 </para>
83 </refsect1>
84
85 <refsect1>
86 <title>Examples</title>
87 <para>
88 Here is an example of the &sol; operator. It uses the file <ulink url="examples/divides.csd"><citetitle>divides.csd</citetitle></ulink>.
89 <example>
90 <title>Example of the &sol; operator.</title>
91 <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>
92 <xi:include href="examples-xml/divides.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
93 </example>
94 Its output should include lines like these:
95 <screen>
96 retrigger rate per note duration = 3.333333
97 retrigger rate per note duration = 5.000000
98 retrigger rate per note duration = 0.666667</screen>
99 </para>
100 </refsect1>
101
102 <refsect1>
103 <title>See also</title>
104 <para><link linkend="MathArtLogic"><citetitle>Arithmetic and Logic Operations</citetitle></link></para>
105 </refsect1>
106
107 <refsect1>
108 <title>Credits</title>
109 <para>Arithmetic on vectors is new in version 6.00</para>
110 </refsect1>
111
112 </refentry>