diff options
Diffstat (limited to 'docs/spec/system.html')
| -rw-r--r-- | docs/spec/system.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/spec/system.html b/docs/spec/system.html index 3616425c..a7c1efab 100644 --- a/docs/spec/system.html +++ b/docs/spec/system.html @@ -474,7 +474,7 @@ <p><code><span class='Modifier'>β’_timed</span></code> returns the total time taken divided by the number of function calls (<code><span class='Value'>π¨</span></code> if provided and 1 otherwise), including the overhead required for the outer loop that counts iterations (which will typically be negligible in comparison to the BQN code).</p> <p>More accurately the modifier <code><span class='Modifier2'>β’_maxTime_</span></code> <em>may</em> fail if execution of <code><span class='Function'>π½</span></code> takes over <code><span class='Value'>π¨</span><span class='Function'>πΎ</span><span class='Value'>π©</span></code> seconds, and should fail as quickly as it is practically able to. The most likely way to implement this modifier is to interrupt execution at the given time. If <code><span class='Function'>π½</span></code> completes before the interrupt there is no need to measure the amount of time it actually took.</p> <h2 id="random-generation"><a class="header" href="#random-generation">Random generation</a></h2> -<p><code><span class='Function'>β’MakeRand</span></code> initializes a deterministic pseudorandom number generator with seed value <code><span class='Value'>π©</span></code>. <code><span class='Value'>β’rand</span></code>, if it exists, is a globally accessible generator initialized at first use; this initialization should use randomness from an outside source if available. A random generator has the following member functions:</p> +<p><code><span class='Function'>β’MakeRand</span></code> initializes a deterministic pseudorandom number generator with seed value <code><span class='Value'>π©</span></code>. <code><span class='Value'>β’rand</span></code>, if it exists, is a globally accessible generator initialized at first use; this initialization should use randomness from an outside source if available. These random generators aren't required to be cryptographically secure and should always be treated as insecure. A random generator has the following member functions:</p> <table> <thead> <tr> @@ -493,11 +493,11 @@ </tr> <tr> <td><code><span class='Function'>Subset</span></code></td> -<td>A sorted SRS of <code><span class='Value'>π¨</span></code> elements of <code><span class='Function'>β</span><span class='Value'>π©</span></code></td> +<td>A sorted SRS of <code><span class='Function'>β</span><span class='Value'>π©</span></code>, with <code><span class='Value'>π¨</span></code> elements if given</td> </tr> </tbody> </table> <p>For each of these functions, <code><span class='Value'>π©</span></code> is a natural number. For <code><span class='Function'>Range</span></code>, <code><span class='Value'>π¨</span></code> must be a valid shape if given, and for <code><span class='Function'>Deal</span></code> and <code><span class='Function'>Subset</span></code> it's a natural number less than or equal to <code><span class='Value'>π©</span></code>. All selections are made uniformly at random, that is, each possible result is equally likely. A simple random sample (SRS) of <code><span class='Value'>k</span></code> elements from list <code><span class='Value'>s</span></code> is a list of <code><span class='Value'>k</span></code> distinct elements of <code><span class='Value'>s</span></code> in any order. Both the choice of elements and their ordering must be uniformly random. <a href="../implementation/primitive/random.html#simple-random-sample">Recommended algorithms</a> for SRS selection are variants of a partial Knuth shuffle.</p> -<p>When <code><span class='Value'>π¨</span></code> isn't given, <code><span class='Function'>Deal</span></code>'s result contains all elements of <code><span class='Function'>β</span><span class='Value'>π©</span></code>, making it a random shuffle of those values, or random permutation. In <code><span class='Function'>Subset</span></code>, setting <code><span class='Value'>π¨</span></code> to <code><span class='Value'>π©</span></code> would instead always result in the list <code><span class='Function'>β</span><span class='Value'>π©</span></code>; because this is not useful, <code><span class='Value'>π¨</span></code> must be provided.</p> +<p>When <code><span class='Value'>π¨</span></code> isn't given, <code><span class='Function'>Deal</span></code>'s result contains all elements of <code><span class='Function'>β</span><span class='Value'>π©</span></code>, making it a random shuffle of those values, or random permutation. In <code><span class='Function'>Subset</span></code>, a random choice is made uniformly from the <code><span class='Number'>2</span><span class='Function'>β</span><span class='Value'>π©</span></code> subsets of <code><span class='Function'>β</span><span class='Value'>π©</span></code>, so that a subset of any length may be returned.</p> <p>In <code><span class='Function'>Range</span></code>, <code><span class='Value'>π©</span></code> may be <code><span class='Number'>0</span></code>. In this case the result consists of floating-point numbers in the unit interval from 0 to 1. The numbers should have an overall uniform distribution, but their precision and whether the endpoints 0 and 1 are possible may depend on the implementation.</p> <p>Ranges up to <code><span class='Number'>2</span><span class='Function'>β</span><span class='Number'>32</span></code> must be supported (that is, a maximum integer result of <code><span class='Paren'>(</span><span class='Number'>2</span><span class='Function'>β</span><span class='Number'>32</span><span class='Paren'>)</span><span class='Function'>-</span><span class='Number'>1</span></code>) if the number system accommodates it. In implementations based on double-precision floats it's preferable but not required to support ranges up to <code><span class='Number'>2</span><span class='Function'>β</span><span class='Number'>53</span></code>.</p> |
