| 1 | |
| 2 | <refentry id="ceil"> |
| 3 | <indexterm id="IndexCeil"><primary>ceil</primary></indexterm> |
| 4 | <refentryinfo><title>Mathematical Operations:Mathematical Functions</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>ceil</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>ceil</refname> |
| 13 | |
| 14 | <refpurpose> |
| 15 | Returns the smallest integer not less than <emphasis>x</emphasis> |
| 16 | </refpurpose> |
| 17 | </refnamediv> |
| 18 | |
| 19 | <refsect1> |
| 20 | <title>Description</title> |
| 21 | <para> |
| 22 | Returns the smallest integer not less than <emphasis>x</emphasis> |
| 23 | </para> |
| 24 | </refsect1> |
| 25 | |
| 26 | <refsect1> |
| 27 | <title>Syntax</title> |
| 28 | <synopsis><command>ceil</command>(x) (init-, control-, or audio-rate arg allowed)</synopsis> |
| 29 | <synopsis><command>ceil</command>(k/i[]) (k- or i-arrays )</synopsis> |
| 30 | <para> |
| 31 | where the argument within the parentheses may be an expression. |
| 32 | Value converters perform arithmetic translation from units of |
| 33 | one kind to units of another. The result can then be a term in a |
| 34 | further expression. |
| 35 | </para> |
| 36 | </refsect1> |
| 37 | |
| 38 | <refsect1> |
| 39 | <title>Examples</title> |
| 40 | <para> |
| 41 | Here is an example of the ceil opcode. It uses the file <ulink |
| 42 | url="examples/ceil.csd"><citetitle>ceil.csd</citetitle></ulink>. |
| 43 | |
| 44 | <example> |
| 45 | <title>Example of the ceil opcode.</title> |
| 46 | <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> |
| 47 | <xi:include href="examples-xml/ceil.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 48 | </example> |
| 49 | |
| 50 | Its output should include lines like: |
| 51 | <screen> |
| 52 | instr 1: iceil = -1.000 |
| 53 | instr 1: iceil = 1.000 |
| 54 | instr 1: iceil = 1.000 |
| 55 | instr 1: iceil = 1.000 |
| 56 | instr 1: iceil = 0.000 |
| 57 | instr 1: iceil = 0.000 |
| 58 | instr 1: iceil = 0.000 |
| 59 | </screen> |
| 60 | Here is another example of the ceil opcode. It uses the file <ulink |
| 61 | url="examples/ceil-2.csd"><citetitle>ceil-2.csd</citetitle></ulink>. |
| 62 | <example> |
| 63 | <title>A second example of the ceil opcode.</title> |
| 64 | <xi:include href="examples-xml/ceil-2.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 65 | </example> |
| 66 | Here is an example for the rounding-group, comparing the different rounding opcodes. It uses the file <ulink url="examples/rounding-group.csd"><citetitle>rounding-group.csd</citetitle></ulink>. |
| 67 | <example> |
| 68 | <title>Example of the rounding group.</title> |
| 69 | <xi:include href="examples-xml/rounding-group.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 70 | </example> |
| 71 | </para> |
| 72 | </refsect1> |
| 73 | |
| 74 | <refsect1> |
| 75 | <title>See also</title> |
| 76 | <para><link linkend="MathMatfunc"><citetitle>Mathematical Functions</citetitle></link></para> |
| 77 | </refsect1> |
| 78 | |
| 79 | <refsect1> |
| 80 | <title>Credits</title> |
| 81 | <para> |
| 82 | <simplelist> |
| 83 | <member>Author: Istvan Varga</member> |
| 84 | <member>New in Csound 5</member> |
| 85 | <member>2005</member> |
| 86 | </simplelist> |
| 87 | </para> |
| 88 | </refsect1> |
| 89 | </refentry> |