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
|
<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>CONDITIONAL_VALUES</TITLE>
</HEAD>
<BODY>
<CENTER><A NAME="CONDITIONAL_VALUES"></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="arith.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="assign.html">Next</A>
<HR></CENTER>
<H2>
CONDITIONAL VALUES:</H2>
<PRE> (a > b ? v1 : v2)
(a < b ? v1 : v2)
(a > = b ? v1 : v2)
(a < = b ? v1 : v2)
(a = = b ? v1 : v2)
(a ! = b ? v1 : v2)</PRE>
<HR>
<H4>
<U>DESCRIPTION</U></H4>
where a, b, v1 and v2 may be expressions, but a, b not audio-rate.
<P>In the above conditionals, a and b are first compared. If the indicated
relation is true (a greater than b, a less than b, a greater than or equal
to b, a less than or equal to b, a equal to b, a not equal to b), then
the conditional expression has the value of v1; if the relation is false,
the expression has the value of v2. (For convenience, a sole `=` will function
as `= =`.)
<P>NB.: If v1 or v2 are expressions, these will be evaluated before the
conditional is determined.
<P>In terms of binding strength, all conditional operators (i.e. the relational
operators (>,<, etc.), and ?, and : ) are weaker than the arithmetic
and logical operators (+, -, *, /, && and ||).
<H4>
<U>EXAMPLE:</U></H4>
<PRE> (k1 < p5/2 + p6 ? k1 : p7)</PRE>
binds the terms p5/2 and p6. It will return the value k1 below this threshold,
else the value p7.
</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="arith.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="assign.html">Next</A>
<HR></CENTER>
<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>©
Jean Piché & Peter J. Nix, 1994-97</FONT></FONT></I></B>
</CENTER>
</HTML>
|