| 1 | |
| 2 | <refentry id="opbitshl"> |
| 3 | <indexterm id="IndexShiftL"><primary>¬</primary></indexterm> |
| 4 | <refentryinfo><title>Mathematical Operations:Arithmetic and Logic Operations</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle><<</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname><<</refname> |
| 11 | |
| 12 | <refpurpose> |
| 13 | Bitshift left operator. |
| 14 | </refpurpose> |
| 15 | </refnamediv> |
| 16 | |
| 17 | <refsect1> |
| 18 | <title>Description</title> |
| 19 | <para> |
| 20 | The bitshift operators shift the bits to the left or to the right the number of bits given. |
| 21 | </para> |
| 22 | |
| 23 | <para> |
| 24 | The priority of these operators is less binding that the |
| 25 | arithmetic ones, but more binding that the comparisons. |
| 26 | </para> |
| 27 | |
| 28 | <para> |
| 29 | Parentheses may be used as above to force particular groupings. |
| 30 | </para> |
| 31 | </refsect1> |
| 32 | |
| 33 | <refsect1> |
| 34 | <title>Syntax</title> |
| 35 | <synopsis>a <command><<</command> b (bitshift left)</synopsis> |
| 36 | |
| 37 | <para> |
| 38 | where the arguments <emphasis>a</emphasis> and <emphasis>b</emphasis> may be further |
| 39 | expressions. |
| 40 | </para> |
| 41 | </refsect1> |
| 42 | <refsect1> |
| 43 | <title>Examples</title> |
| 44 | <para> |
| 45 | Here is an example of the bitshift left operator. It uses the file <ulink url="examples/bitshift.csd"><citetitle>bitshift.csd</citetitle></ulink>. |
| 46 | <example> |
| 47 | <title>Example of the bitshift left operator.</title> |
| 48 | <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> |
| 49 | <xi:include href="examples-xml/bitshift.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 50 | </example> |
| 51 | </para> |
| 52 | <para>The example above will produce the following output: |
| 53 | <literallayout>2>>1 = 1 |
| 54 | B 0.000 .. 0.100 T 0.100 TT 0.100 M: 0.0 0.0 |
| 55 | 3>>1 = 1 |
| 56 | B 0.100 .. 0.200 T 0.200 TT 0.200 M: 0.0 0.0 |
| 57 | 7>>2 = 1 |
| 58 | B 0.200 .. 0.300 T 0.300 TT 0.300 M: 0.0 0.0 |
| 59 | 16>>1 = 8 |
| 60 | B 0.300 .. 0.400 T 0.400 TT 0.400 M: 0.0 0.0 |
| 61 | 16>>2 = 4 |
| 62 | B 0.400 .. 0.500 T 0.500 TT 0.500 M: 0.0 0.0 |
| 63 | 16>>3 = 2 |
| 64 | B 0.500 .. 5.000 T 5.000 TT 5.000 M: 0.0 0.0 |
| 65 | new alloc for instr 2: |
| 66 | 1<<1 = 2 |
| 67 | B 5.000 .. 5.100 T 5.100 TT 5.100 M: 0.0 0.0 |
| 68 | 1<<2 = 4 |
| 69 | B 5.100 .. 5.200 T 5.200 TT 5.200 M: 0.0 0.0 |
| 70 | 1<<3 = 8 |
| 71 | B 5.200 .. 5.300 T 5.300 TT 5.300 M: 0.0 0.0 |
| 72 | 1<<4 = 16 |
| 73 | B 5.300 .. 5.400 T 5.400 TT 5.400 M: 0.0 0.0 |
| 74 | 2<<1 = 4 |
| 75 | B 5.400 .. 5.500 T 5.500 TT 5.500 M: 0.0 0.0 |
| 76 | 2<<2 = 8 |
| 77 | B 5.500 .. 5.600 T 5.600 TT 5.600 M: 0.0 0.0 |
| 78 | 2<<3 = 16 |
| 79 | B 5.600 .. 5.700 T 5.700 TT 5.700 M: 0.0 0.0 |
| 80 | 3<<2 = 12</literallayout> |
| 81 | </para> |
| 82 | </refsect1> |
| 83 | |
| 84 | <refsect1> |
| 85 | <title>See also</title> |
| 86 | <para><link linkend="MathArtLogic"><citetitle>Arithmetic and Logic Operations</citetitle></link></para> |
| 87 | </refsect1> |
| 88 | |
| 89 | </refentry> |