1 |
<html> |
2 |
<head> |
3 |
<meta name="author" content="Christian Schoenebeck"> |
4 |
<title>max() function</title> |
5 |
<meta name="description" content="Calculates the maximum value of two given values."> |
6 |
</head> |
7 |
<body> |
8 |
<h1>max()</h1> |
9 |
<p> |
10 |
Returns the maximum value of the passed two value arguments. |
11 |
That means, it compares the two passed values with each other and |
12 |
returns the one which is larger. |
13 |
</p> |
14 |
|
15 |
<h3>Function Prototype</h3> |
16 |
<p/> |
17 |
<code lang="nksp"> |
18 |
max(??number1??,??number2??) |
19 |
</code> |
20 |
|
21 |
<h3>Arguments</h3> |
22 |
<table> |
23 |
<tr> |
24 |
<th>Argument Name</th> <th>Data Type</th> <th>Description</th> |
25 |
</tr> |
26 |
<tr> |
27 |
<td><code>??number1??</code></td> |
28 |
<td>Integer Number or<br> |
29 |
Real Number</td> |
30 |
<td>One of the two numbers to compare with.<br> |
31 |
[required]</td> |
32 |
</tr> |
33 |
<tr> |
34 |
<td><code>??number2??</code></td> |
35 |
<td>Integer Number or<br> |
36 |
Real Number</td> |
37 |
<td>One of the two numbers to compare with.<br> |
38 |
[required]</td> |
39 |
</tr> |
40 |
</table> |
41 |
|
42 |
<h3>Return Value</h3> |
43 |
<table> |
44 |
<tr> |
45 |
<th>Data Type</th> <th>Description</th> |
46 |
</tr> |
47 |
<tr> |
48 |
<td>Integer Number</td> |
49 |
<td>Largest number of the passed two values.</td> |
50 |
</tr> |
51 |
</table> |
52 |
|
53 |
<h3>Remarks</h3> |
54 |
<p> |
55 |
This functions accepts any standard unit and finalness for its two arguments. |
56 |
However the unit types of the two arguments must be identical. |
57 |
The return value's unit type is identical to the two passed arguments' one, |
58 |
and the return value's finalness is the case if at least one of the two arguments |
59 |
has finalness. |
60 |
</p> |
61 |
|
62 |
<h3>Examples</h3> |
63 |
<p> |
64 |
The following example prints the result of some example argument |
65 |
values to the terminal as soon as the script is loaded. |
66 |
<p/> |
67 |
<code> |
68 |
on init |
69 |
message("max(2,3) = " & max(2,3)) |
70 |
message("max(1,11) = " & max(1,11)) |
71 |
message("max(-30,4) = " & max(-30,4)) |
72 |
end on |
73 |
</code> |
74 |
|
75 |
<h3>See also</h3> |
76 |
<p><code>min()</code><p> |
77 |
|
78 |
<h3>Availability</h3> |
79 |
<p>Since LinuxSampler 2.0.0.svn23.<p> |
80 |
|
81 |
</body> |
82 |
</html> |