summaryrefslogtreecommitdiffstats
path: root/random.txi
diff options
context:
space:
mode:
authorJames LewisMoss <dres@debian.org>1999-12-06 19:32:57 -0500
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:28 -0800
commitc394920caedf3dac1981bb6b10eeb47fd6e4bb21 (patch)
treef21194653a3554f747dde3df908df993c48db5a0 /random.txi
parent926b1b647ac830660933a5e63eb52d4a2552e264 (diff)
parentbd9733926076885e3417b74de76e4c9c7bc56254 (diff)
downloadslib-c394920caedf3dac1981bb6b10eeb47fd6e4bb21.tar.gz
slib-c394920caedf3dac1981bb6b10eeb47fd6e4bb21.zip
Import Debian changes 2c7-1debian/2c7-1
slib (2c7-1) unstable; urgency=low * New upstream. * Add slibconfig back in. slib (2c6-2) unstable; urgency=low * Remove the slib$(VERSION).info file. Cut the diff back down to size. slib (2c6-1) unstable; urgency=low * New upstream. * Move docs to /usr/share. Up standards version. add /usr/doc symlink. Move info files. Remove undocumented link. slib (2c5-6) unstable; urgency=low * Lowercase two vars in yasyn.scm (Fixes bug #37222) slib (2c5-5) unstable; urgency=low * Fix it so string-index isn't defined (now there is a strsrch:string-index) (Fixes #38812) slib (2c5-4) unstable; urgency=low * Don't run slibconfig in postinst. (Fixes bug #38253, #37733, #37715, #37746, #37809, #37917, #38123, #38462) slib (2c5-3) unstable; urgency=low * Run slibconfig in postinst. It was commented out there, but I don't see any old bug reports on why it was commented out, so let's try again. :) (Fixes bug #37221) slib (2c5-2) unstable; urgency=low * Link mklibcat.scm to mklibcat. Fixes a problem with using slib with guile. slib (2c5-1) unstable; urgency=low * New upstream. slib (2c3-4) unstable; urgency=low * New maintainer.
Diffstat (limited to 'random.txi')
-rw-r--r--random.txi69
1 files changed, 69 insertions, 0 deletions
diff --git a/random.txi b/random.txi
new file mode 100644
index 0000000..f144837
--- /dev/null
+++ b/random.txi
@@ -0,0 +1,69 @@
+
+
+
+
+
+@defun random n
+
+
+@defunx random n state
+Accepts a positive integer or real @var{n} and returns a number of the
+same type between zero (inclusive) and @var{n} (exclusive). The values
+returned by @code{random} are uniformly distributed from 0 to @var{n}.
+
+The optional argument @var{state} must be of the type returned by
+@code{(seed->random-state)} or @code{(make-random-state)}. It defaults
+to the value of the variable @code{*random-state*}. This object is used
+to maintain the state of the pseudo-random-number generator and is
+altered as a side effect of calls to @code{random}.
+@end defun
+
+
+
+
+@defvar *random-state*
+Holds a data structure that encodes the internal state of the
+random-number generator that @code{random} uses by default. The nature
+of this data structure is implementation-dependent. It may be printed
+out and successfully read back in, but may or may not function correctly
+as a random-number state object in another implementation.
+@end defvar
+
+
+@defun copy-random-state state
+
+Returns a new copy of argument @var{state}.
+
+
+@defunx copy-random-state
+Returns a new copy of @code{*random-state*}.
+@end defun
+
+
+
+@defun seed->random-state seed
+
+Returns a new object of type suitable for use as the value of the
+variable @code{*random-state*} or as a second argument to @code{random}.
+The number or string @var{seed} is used to initialize the state. If
+@code{seed->random-state} is called twice with arguments which are
+@code{equal?}, then the returned data structures will be @code{equal?}.
+Calling @code{seed->random-state} with unequal arguments will nearly
+always return unequal states.
+@end defun
+
+
+
+@defun make-random-state
+
+
+@defunx make-random-state obj
+Returns a new object of type suitable for use as the value of the
+variable @code{*random-state*} or as a second argument to @code{random}.
+If the optional argument @var{obj} is given, it should be a printable
+Scheme object; the first 50 characters of its printed representation
+will be used as the seed. Otherwise the value of @code{*random-state*}
+is used as the seed.
+@end defun
+
+