1 |
<html> |
2 |
<head> |
3 |
<meta name="author" content="Christian Schoenebeck"> |
4 |
<title>real_to_int() function</title> |
5 |
<meta name="description" content="Type cast from real number to integer number."> |
6 |
</head> |
7 |
<body> |
8 |
<h1>real_to_int()</h1> |
9 |
<p> |
10 |
Performs a type cast from real number to integer number, which means |
11 |
it converts the passed <code lang="nksp">??real-number??</code> to an integer number |
12 |
and returns the latter as result value. |
13 |
</p> |
14 |
<note> |
15 |
Any fractional value behind the decimal point of <code>??real-number??</code> |
16 |
is ignored by this conversion. So e.g. <code>real_to_int(3.999)</code> would |
17 |
return <code>3</code>. If that's not what you want, then you might consider |
18 |
using e.g. <code>round()</code> or <code>ceil()</code> before doing the |
19 |
actual type conversion with this function. |
20 |
</note> |
21 |
|
22 |
<h3>Function Prototype</h3> |
23 |
<p/> |
24 |
<code lang="nksp"> |
25 |
real_to_int(??real-number??) |
26 |
</code> |
27 |
|
28 |
<h3>Arguments</h3> |
29 |
<table> |
30 |
<tr> |
31 |
<th>Argument Name</th> <th>Data Type</th> <th>Description</th> |
32 |
</tr> |
33 |
<tr> |
34 |
<td><code>??real-number??</code></td> |
35 |
<td>Real Number</td> |
36 |
<td>The real number to be converted.<br> |
37 |
[required]</td> |
38 |
</tr> |
39 |
</table> |
40 |
|
41 |
<h3>Return Value</h3> |
42 |
<table> |
43 |
<tr> |
44 |
<th>Data Type</th> <th>Description</th> |
45 |
</tr> |
46 |
<tr> |
47 |
<td>Integer Number</td> |
48 |
<td>Truncated Integer Number representation of the passed Real Number.</td> |
49 |
</tr> |
50 |
</table> |
51 |
|
52 |
<h3>Remarks</h3> |
53 |
<p> |
54 |
This functions accepts any standard unit and finalness for its argument <code>??real-number??</code>. |
55 |
The return value's standard unit and finalness is identical to the passed <code>??real-number??</code>'s one. |
56 |
</p> |
57 |
|
58 |
<h3>Examples</h3> |
59 |
<p>None yet.</p> |
60 |
|
61 |
<h3>See also</h3> |
62 |
<p><code>int()</code>, <code>int_to_real()</code>, <code>round()</code>, <code>ceil()</code><p> |
63 |
|
64 |
<h3>Availability</h3> |
65 |
<p>Since LinuxSampler 2.1.1.svn6.<p> |
66 |
|
67 |
</body> |
68 |
</html> |