/[svn]/doc/docbase/instrument_scripts/nksp/reference/functions/nksp_random_function.html
ViewVC logotype

Contents of /doc/docbase/instrument_scripts/nksp/reference/functions/nksp_random_function.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3610 - (show annotations) (download) (as text)
Tue Sep 24 12:39:07 2019 UTC (4 years, 6 months ago) by schoenebeck
File MIME type: text/html
File size: 2086 byte(s)
- NKSP: Minor doc fix for random().

1 <html>
2 <head>
3 <meta name="author" content="Christian Schoenebeck">
4 <title>random() function</title>
5 <meta name="description" content="Random number generator function.">
6 </head>
7 <body>
8 <h1>random()</h1>
9 <p>
10 Provides a pseudo random number generator. Each time this function
11 is called, another random number will be returned.
12 </p>
13
14 <h3>Function Prototype</h3>
15 <p/>
16 <code lang="nksp">
17 random(??minimum??, ??maximum??)
18 </code>
19
20 <h3>Arguments</h3>
21 <table>
22 <tr>
23 <th>Argument Name</th> <th>Data Type</th> <th>Description</th>
24 </tr>
25 <tr>
26 <td><code>??minimum??</code></td>
27 <td>Integer&nbsp;Number&nbsp;or<br>
28 Real&nbsp;Number</td>
29 <td>The smallest number of allowed value range (including this value).<br>
30 [required]</td>
31 </tr>
32 <tr>
33 <td><code>??maximum??</code></td>
34 <td>Integer&nbsp;Number&nbsp;or<br>
35 Real&nbsp;Number</td>
36 <td>The highest number of allowed value range (including this value).<br>
37 [required]</td>
38 </tr>
39 </table>
40
41 <h3>Return Value</h3>
42 <table>
43 <tr>
44 <th>Data Type</th>
45 <th>Description</th>
46 </tr>
47 <tr>
48 <td>Integer&nbsp;Number&nbsp;or<br>
49 Real&nbsp;Number</td>
50 <td>Next random number within the requested value range.</td>
51 </tr>
52 </table>
53
54 <h3>Remarks</h3>
55 <p>
56 This functions accepts any standard unit and finalness for its two arguments.
57 However the unit types of the two arguments must be identical.
58 The return value's unit type is identical to the two passed arguments' one,
59 and the return value's finalness is the case if at least one of the two arguments
60 has finalness.
61 </p>
62
63 <h3>Examples</h3>
64 <p/>
65 <code>
66 on init
67 message("random(-5,5) = " & random(-5,5))
68 message("random(-5,5) = " & random(-5,5))
69 message("random(-5,5) = " & random(-5,5))
70 message("random(-5,5) = " & random(-5,5))
71 end on
72 </code>
73
74 </body>
75 </html>

  ViewVC Help
Powered by ViewVC