Commit Graph

35 Commits

Author SHA1 Message Date
Raymond Hettinger 2f726e9093 SF bug #812202: randint is always even
* Added C coded getrandbits(k) method that runs in linear time.
* Call the new method from randrange() for ranges >= 2**53.
* Adds a warning for generators not defining getrandbits() whenever they
  have a call to randrange() with too large of a population.
2003-10-05 09:09:15 +00:00
Raymond Hettinger f8a52d38ad Removed deprecated functions 2003-08-05 12:23:19 +00:00
Raymond Hettinger 40f6217092 SF patch 658251: Install a C implementation of the Mersenne Twister as the
core generator for random.py.
2002-12-29 23:03:38 +00:00
Raymond Hettinger 311f419628 Improve comments. Clarify docs.
Replace "type(0)" with "int".
Replace "while 1" with "while True"
2002-11-18 09:01:24 +00:00
Raymond Hettinger f24eb35d18 SF patch 629637: Add sample(population, k) method to the random module.
Used for random sampling without replacement.
2002-11-12 17:41:57 +00:00
Fred Drake 92bf9dacc9 Markup adjustments; fix the names of modules referenced in an expression. 2002-05-23 21:07:19 +00:00
Raymond Hettinger c32f0336e0 Deprecated Random.cunifvariate clearing bug 506647. Also, added docstrings. 2002-05-23 19:44:49 +00:00
Raymond Hettinger 576474c5ae Closes SF bug 527139. Brings docs inline with random.py 1.29
which fixes the unnecessarily restricted method domain.
2002-05-13 23:49:13 +00:00
Raymond Hettinger 5359ad63ce Correct gammavariate's method name and domain.
Partial solution to SF bug 527139.
2002-05-13 22:40:38 +00:00
Fred Drake d4c0e5fd5b BDFL agreed with Tim: rehabilitate randint(). 2002-04-12 20:01:47 +00:00
Fred Drake 4cacec5393 Fix a number of minor markup errors. 2001-04-21 05:56:06 +00:00
Fred Drake 844bd5b4a9 Minor markup adjustments. 2001-02-02 02:42:31 +00:00
Fred Drake d0946da701 Fix some markup breakage that prevented formatting; re-wrapped a couple of
wide paragraphs.
2001-02-01 15:53:24 +00:00
Tim Peters 0de88fc4b1 Change random.seed() so that it can get at the full range of possible
internal states.  Put the old .seed() (which could only get at about
the square root of the # of possibilities) under the new name .whseed(),
for bit-level compatibility with older versions.  This occurred to me
while reviewing effbot's book (he found himself stumbling over .seed()
more than once there ...).
2001-02-01 04:59:18 +00:00
Tim Peters e360d9507a The combo of getstate/setstate/jumpahead is very powerful, but needs
examples to flesh it out for the uninitiated.  Here they are.
2001-01-26 10:00:39 +00:00
Tim Peters d52269bfd0 Fix bugs introduced by rewrite (in particular, time-based initialization
got broken).  Also added new method .jumpahead(N).  This finally gives us
a semi-decent answer to how Python's RNGs can be used safely and efficiently
in multithreaded programs (although it requires the user to use the new
machinery!).
2001-01-25 06:23:18 +00:00
Tim Peters d7b5e88e8e Reworked random.py so that it no longer depends on, and offers all the
functionality of, whrandom.py.  Also closes all the "XXX" todos in
random.py.  New frequently-requested functions/methods getstate() and
setstate().  All exported functions are now bound methods of a hidden
instance.  Killed all unintended exports.  Updated the docs.
FRED:  The more I fiddle the docs, the less I understand the exact
intended use of the \var, \code, \method tags.  Please review critically.
GUIDO:  See email.  I updated NEWS as if whrandom were deprecated; I
think it should be.
2001-01-25 03:36:26 +00:00
Barry Warsaw 83125775e0 A \begin{funcdesc} was closed with an \end{methoddesc}. 2001-01-25 00:39:16 +00:00
Tim Peters 902446a28d Supply long-missing docs for random.seed(). Extensive rewrite of module
intro docs.
*************** Fred:  check my LaTeX!  Also, the docs for whrandom should
*************** be moved into Obsolete Modules.
2001-01-24 23:06:53 +00:00
Fred Drake 5f0decf0d3 Clean up the docs for the "random" module according to comments from Tim
Peters.

This closes SF bug #125919.
2001-01-22 18:18:30 +00:00
Fred Drake 065cba1281 Added documentation for random.shuffle(). 2000-12-15 19:07:17 +00:00
Fred Drake f0e88980f3 Document randrange(). 2000-06-30 15:32:31 +00:00
Fred Drake 38e5d27cae Merged changes from the 1.5.2p2 release.
(Very rough.)
2000-04-03 20:13:55 +00:00
Fred Drake 048b75bd9a Make references to whrandom hyperlinks. 1999-04-21 18:14:22 +00:00
Fred Drake 295da24eaf New section header style.
Fix up a few synopses.
1998-08-10 19:42:37 +00:00
Fred Drake b91e934cf1 Adjusted to use the new module synopsis support macros. 1998-07-23 17:59:49 +00:00
Guido van Rossum a933f6a53d Fix vonmisesvariate() -- it now returns an angle between 0 and *two*
times pi.  Got rid of $math$ here and in one other place.
1998-04-20 14:43:44 +00:00
Fred Drake 3a0351cf85 Remove all uses of \sectcode; we can now use logical markup everywhere. 1998-04-04 07:23:21 +00:00
Fred Drake d275de985a Remove obsolete lines like this:
\setindexsubitem{(in module frobnitz)}

These are no longer needed when present before any other \setindexsubitem{}
in the module section.  The indexsubitem is now set by \bimodindex and
\stmodindex.
1998-04-04 05:56:51 +00:00
Fred Drake 4e6688747c Consistency nits:
Use math-mode pi instead of mixing forms.

Use spaces around relational operators.
1998-04-03 06:04:12 +00:00
Fred Drake 2eda4ca4df Markup adjustments. 1998-03-08 08:13:53 +00:00
Fred Drake 1947991c2f Remove all \bcode / \ecode cruft; this is no longer needed. See previous
checkin of myformat.sty.

Change "\renewcommand{\indexsubitem}{(...)}" to "\setindexsubitem{(...)}"
everywhere.

Some other minor nits that I happened to come across.
1998-02-13 06:58:54 +00:00
Guido van Rossum 4f80b65aa6 Added "docs" for Pareto and Weibull distributions. 1997-12-30 17:38:05 +00:00
Guido van Rossum e47da0ae04 AMK's megapatch:
* \bcode, \ecode added everywhere
	* \label{module-foo} added everywhere
	* A few \seealso sections added.
	* Indentation fixed inside verbatim in lib*tex files
1997-07-17 16:34:52 +00:00
Guido van Rossum 571391b963 New stuff by AMK. 1997-04-03 22:41:49 +00:00