File: arith.html

package info (click to toggle)
csound-doc 3.47b2-2
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 1,492 kB
  • ctags: 272
  • sloc: makefile: 36
file content (79 lines) | stat: -rw-r--r-- 3,082 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="GENERATOR" CONTENT="Mozilla/4.03 [en] (X11; I; IRIX 6.3 IP32) [Netscape]">
   <TITLE>ARITHMETIC_OPERATIONS</TITLE>
</HEAD>
<BODY>

<CENTER><A NAME="ARITHMETIC_OPERATIONS"></A>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="SYNTAX.html">Top of this section</A></B> - <A HREF="expr.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="cond.html">Next</A>&nbsp;
<HR></CENTER>

<H2>
ARITHMETIC OPERATIONS</H2>

<PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - a
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + a&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&nbsp; &amp;&amp; b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (logical AND;&nbsp; not audio-rate)&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&nbsp; || b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (logical OR;&nbsp;&nbsp; not audio-rate)&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&nbsp; +&nbsp; b
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&nbsp; -&nbsp; b&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&nbsp; *&nbsp; b&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&nbsp; /&nbsp; b</PRE>

<HR>
<H4>
<U>DESCRIPTION</U></H4>
where the arguments a and b may be further expressions.

<P>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
<PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a + b * c.</PRE>
In such cases three rules apply:
<UL>
<LI>
<B>*</B> and <B>/</B> bind to their neighbors more strongly than + and
-. Thus the above expression is taken as</LI>


<P><TT>a + (b * c),</TT>

<P>with * taking b and c and then + taking a and b * c.
<LI>
<B>+</B> and <B>-</B> bind more strongly than &amp;&amp;, which in turn
is stronger than ||:</LI>


<P><TT>a &amp;&amp; b - c || d</TT>

<P>is taken as <TT>(a &amp;&amp; (b-c)) || d</TT>
<LI>
When both operators bind equally strongly, the operations are done left
to right:</LI>


<P><TT>a - b - c</TT>

<P>is taken as <TT>(a - b) - c</TT>.</UL>
Parentheses may be used as above to force particular groupings.
</BODY>
<CENTER><P>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="SYNTAX.html">Top of this section</A></B> - <A HREF="expr.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="cond.html">Next</A>&nbsp;
<HR></CENTER>


<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>&copy;
Jean Pich&eacute; &amp; Peter J. Nix, 1994-97</FONT></FONT></I></B>&nbsp;
</CENTER>
</HTML>