<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" dir="ltr" class="client-nojs">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Pseudo-random number generation - cppreference.com</title>
<meta charset="UTF-8">
<meta name="generator" content="MediaWiki 1.18.2">
<link rel="shortcut icon" href="../../../favicon.ico">
<link rel="stylesheet" href="../../../common/load202e.css?debug=false&amp;lang=en&amp;modules=mediawiki.legacy.commonPrint%2Cshared%7Cskins.cppreference2&amp;only=styles&amp;skin=cppreference2&amp;*">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" href="../../../common/load7fe1.css?debug=false&amp;lang=en&amp;modules=site&amp;only=styles&amp;skin=cppreference2&amp;*">
<style>a:lang(ar),a:lang(ckb),a:lang(fa),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}a.new,#quickbar a.new{color:#ba0000}#toc{display:none}.editsection{display:none}

/* cache key: mwiki1-mwiki_en_:resourceloader:filter:minify-css:4:b677bc2b5ec37947892a2d0853532528 */</style>
<script src="../../../common/load404e.php?debug=false&amp;lang=en&amp;modules=startup&amp;only=scripts&amp;skin=cppreference2&amp;*"></script><script>if(window.mw){
	mw.config.set({"wgCanonicalNamespace": "", "wgCanonicalSpecialPageName": false, "wgNamespaceNumber": 0, "wgPageName": "cpp/numeric/random", "wgTitle": "cpp/numeric/random", "wgCurRevisionId": 34429, "wgArticleId": 2063, "wgIsArticle": true, "wgAction": "view", "wgUserName": null, "wgUserGroups": ["*"], "wgCategories": [], "wgBreakFrames": false, "wgRestrictionEdit": [], "wgRestrictionMove": []});
}
</script><script>if(window.mw){
	mw.loader.load(["mediawiki.page.startup"]);
}
</script><style type="text/css">/*<![CDATA[*/
.source-cpp {line-height: normal;}
.source-cpp li, .source-cpp pre {
	line-height: normal; border: 0px none white;
}
/**
 * GeSHi Dynamically Generated Stylesheet
 * --------------------------------------
 * Dynamically generated stylesheet for cpp
 * CSS class: source-cpp, CSS id: 
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 * --------------------------------------
 */
.cpp.source-cpp .de1, .cpp.source-cpp .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
.cpp.source-cpp  {font-family:monospace;}
.cpp.source-cpp .imp {font-weight: bold; color: red;}
.cpp.source-cpp li, .cpp.source-cpp .li1 {font-weight: normal; vertical-align:top;}
.cpp.source-cpp .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
.cpp.source-cpp .li2 {font-weight: bold; vertical-align:top;}
.cpp.source-cpp .kw1 {color: #0000dd;}
.cpp.source-cpp .kw2 {color: #0000ff;}
.cpp.source-cpp .kw3 {color: #0000dd;}
.cpp.source-cpp .kw4 {color: #0000ff;}
.cpp.source-cpp .co1 {color: #909090;}
.cpp.source-cpp .co2 {color: #339900;}
.cpp.source-cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp.source-cpp .es0 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es1 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es2 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es3 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es4 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es5 {color: #008000; font-weight: bold;}
.cpp.source-cpp .br0 {color: #008000;}
.cpp.source-cpp .sy0 {color: #008000;}
.cpp.source-cpp .sy1 {color: #000080;}
.cpp.source-cpp .sy2 {color: #000040;}
.cpp.source-cpp .sy3 {color: #000040;}
.cpp.source-cpp .sy4 {color: #008080;}
.cpp.source-cpp .st0 {color: #008000;}
.cpp.source-cpp .nu0 {color: #000080;}
.cpp.source-cpp .nu6 {color: #000080;}
.cpp.source-cpp .nu8 {color: #000080;}
.cpp.source-cpp .nu12 {color: #000080;}
.cpp.source-cpp .nu16 {color:#000080;}
.cpp.source-cpp .nu17 {color:#000080;}
.cpp.source-cpp .nu18 {color:#000080;}
.cpp.source-cpp .nu19 {color:#000080;}
.cpp.source-cpp .ln-xtra, .cpp.source-cpp li.ln-xtra, .cpp.source-cpp div.ln-xtra {background-color: #ffc;}
.cpp.source-cpp span.xtra { display:block; }

/*]]>*/
</style>
<!--[if lt IE 7]><style type="text/css">body{behavior:url("/mwiki/skins/cppreference2/csshover.min.htc")}</style><![endif]-->
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_numeric_random action-view skin-cppreference2 cpp-navbar">
        <!-- header -->
        
        <!-- /header -->
        <!-- content -->
        <div id="cpp-content-base">
            <div id="content">
                <a id="top"></a>
                <div id="mw-js-message" style="display:none;"></div>
                                <!-- firstHeading -->
                <h1 id="firstHeading" class="firstHeading">Pseudo-random number generation</h1>
                <!-- /firstHeading -->
                <!-- bodyContent -->
                <div id="bodyContent">
                                        <!-- tagline -->
                    <div id="siteSub">From cppreference.com</div>
                    <!-- /tagline -->
                                        <!-- subtitle -->
                    <div id="contentSub"><span class="subpages">&lt; <a href="../../cpp.html" title="cpp">cpp</a> | <a href="../numeric.html" title="cpp/numeric">numeric</a></span></div>
                    <!-- /subtitle -->
                                                            <!-- bodycontent -->
                    <div lang="en" dir="ltr" class="mw-content-ltr">
<div class="t-navbar" style="">
<div class="t-navbar-sep"> </div>
<div class="t-navbar-head">
<a href="../../cpp.html" title="cpp"> C++</a><div class="t-navbar-menu"><div><div>
<table class="t-sb-list-begin" cellpadding="0" style="line-height:1.1em;">
<tr><td colspan="5">  <a href="../language.html" title="cpp/language"> Language</a>
</td></tr>
<tr><td colspan="5">  <a href="../concept.html" title="cpp/concept"> Concepts</a>
</td></tr>
<tr><td colspan="5">  <a href="../utility.html" title="cpp/utility"> Utilities library</a>
</td></tr>
<tr><td colspan="5">  <a href="../string.html" title="cpp/string"> Strings library</a>
</td></tr>
<tr><td colspan="5">  <a href="../container.html" title="cpp/container"> Containers library</a>
</td></tr>
<tr><td colspan="5">  <a href="../algorithm.html" title="cpp/algorithm"> Algorithms library</a>
</td></tr>
<tr><td colspan="5">  <a href="../iteratorhtml.html" title="cpp/iterator"> Iterators library</a>
</td></tr>
<tr><td colspan="5">  <a href="../numeric.html" title="cpp/numeric"> Numerics library</a>
</td></tr>
<tr><td colspan="5">  <a href="../io.html" title="cpp/io"> Input/output library</a>
</td></tr>
<tr><td colspan="5">  <a href="../locale.html" title="cpp/locale"> Localizations library</a>
</td></tr>
<tr><td colspan="5">  <a href="../regex.html" title="cpp/regex"> Regular expressions library</a> <span class="t-mark">(C++11)</span>
</td></tr>
<tr><td colspan="5">  <a href="../atomic.html" title="cpp/atomic"> Atomic operations library</a> <span class="t-mark">(C++11)</span>
</td></tr>
<tr><td colspan="5">  <a href="../thread.html" title="cpp/thread"> Thread support library</a> <span class="t-mark">(C++11)</span>
</td></tr>
</table>
</div></div></div>
</div>
<div class="t-navbar-sep"> </div>
<div class="t-navbar-head">
<a href="../numeric.html" title="cpp/numeric"> Numerics library</a><div class="t-navbar-menu"><div><div>
<table class="t-sb-list-begin" cellpadding="0" style="">
<tr><td colspan="5">  <a href="math.html" title="cpp/numeric/math">Common mathematical functions</a>
</td></tr>
<tr><td colspan="5">  <a href="fenv.html" title="cpp/numeric/fenv">Floating-point environment</a>
</td></tr>
<tr><td colspan="5">  <a href="complex.html" title="cpp/numeric/complex">Complex numbers</a>
</td></tr>
<tr><td colspan="5">  <a href="valarray.html" title="cpp/numeric/valarray">Numeric arrays</a>
</td></tr>
<tr><td colspan="5">  <strong class="selflink">Pseudo-random number generation</strong>
</td></tr>
<tr><td colspan="5">  <a href="ratio.html" title="cpp/numeric/ratio"> Compile-time rational arithmetic</a> <span class="t-mark">(C++11)</span>
</td></tr>
<tr class="t-sb-list-h2"><td colspan="5">  Generic numeric operations
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="../algorithm/iotahtml.html" title="cpp/algorithm/iota">iota</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr><td><a href="../algorithm/accumulate.html" title="cpp/algorithm/accumulate">accumulate</a></td></tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr><td><a href="../algorithm/inner_product.html" title="cpp/algorithm/inner product">inner_product</a></td></tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr><td><a href="../algorithm/adjacent_differencehtml.html" title="cpp/algorithm/adjacent difference">adjacent_difference</a></td></tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr><td><a href="../algorithm/partial_sum.html" title="cpp/algorithm/partial sum">partial_sum</a></td></tr></table>
</td></tr>
</table>
</div></div></div>
</div>
<div class="t-navbar-sep"> </div>
<div class="t-navbar-head">
<strong class="selflink">Pseudo-random number generation</strong><div class="t-navbar-menu"><div><div>
<table class="t-sb-list-begin" cellpadding="0" style="">
<tr class="t-sb-list-h1"><td colspan="5">  Engines and engine adaptors
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/linear_congruential_engine.html" title="cpp/numeric/random/linear congruential engine">linear_congruential_engine</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/mersenne_twister_engine.html" title="cpp/numeric/random/mersenne twister engine">mersenne_twister_engine</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/subtract_with_carry_engine.html" title="cpp/numeric/random/subtract with carry engine">subtract_with_carry_engine</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/discard_block_enginehtml.html" title="cpp/numeric/random/discard block engine">discard_block_engine</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/independent_bits_engine.html" title="cpp/numeric/random/independent bits engine">independent_bits_engine</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/shuffle_order_engine.html" title="cpp/numeric/random/shuffle order engine">shuffle_order_engine</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr class="t-sb-list-h1"><td colspan="5">  Generators
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/random_devicehtml.html" title="cpp/numeric/random/random device">random_device</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr class="t-sb-list-h1"><td colspan="5">  Distributions
</td></tr>
<tr class="t-sb-list-h2"><td colspan="5">  Uniform distributions
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/uniform_int_distribution.html" title="cpp/numeric/random/uniform int distribution">uniform_int_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/uniform_real_distribution.html" title="cpp/numeric/random/uniform real distribution">uniform_real_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/generate_canonicalhtml.html" title="cpp/numeric/random/generate canonical">generate_canonical</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr class="t-sb-list-h2"><td colspan="5">  Bernoulli distributions
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/bernoulli_distribution.html" title="cpp/numeric/random/bernoulli distribution">bernoulli_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/binomial_distribution.html" title="cpp/numeric/random/binomial distribution">binomial_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/negative_binomial_distributionhtml.html" title="cpp/numeric/random/negative binomial distribution">negative_binomial_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/geometric_distribution.html" title="cpp/numeric/random/geometric distribution">geometric_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr class="t-sb-list-h2"><td colspan="5">  Poisson distributions
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/poisson_distribution.html" title="cpp/numeric/random/poisson distribution">poisson_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/exponential_distributionhtml.html" title="cpp/numeric/random/exponential distribution">exponential_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/gamma_distribution.html" title="cpp/numeric/random/gamma distribution">gamma_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/weibull_distribution.html" title="cpp/numeric/random/weibull distribution">weibull_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/extreme_value_distribution.html" title="cpp/numeric/random/extreme value distribution">extreme_value_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr class="t-sb-list-h2"><td colspan="5">  Normal distributions
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/normal_distributionhtml.html" title="cpp/numeric/random/normal distribution">normal_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/lognormal_distribution.html" title="cpp/numeric/random/lognormal distribution">lognormal_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/chi_squared_distribution.html" title="cpp/numeric/random/chi squared distribution">chi_squared_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/cauchy_distributionhtml.html" title="cpp/numeric/random/cauchy distribution">cauchy_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/fisher_f_distribution.html" title="cpp/numeric/random/fisher f distribution">fisher_f_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/student_t_distribution.html" title="cpp/numeric/random/student t distribution">student_t_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr class="t-sb-list-h2"><td colspan="5">  Sampling distributions
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/discrete_distributionhtml.html" title="cpp/numeric/random/discrete distribution">discrete_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/piecewise_constant_distribution.html" title="cpp/numeric/random/piecewise constant distribution">piecewise_constant_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/piecewise_linear_distribution.html" title="cpp/numeric/random/piecewise linear distribution">piecewise_linear_distribution</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr class="t-sb-list-h1"><td colspan="5">  Seed Sequences
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr>
<td><a href="random/seed_seqhtml.html" title="cpp/numeric/random/seed seq">seed_seq</a></td>
<td><span class="t-mark">(C++11)</span></td>
</tr></table>
</td></tr>
<tr class="t-sb-list-h1"><td colspan="5">  C library
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr><td><a href="random/rand.html" title="cpp/numeric/random/rand">rand</a></td></tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr><td><a href="random/srand.html" title="cpp/numeric/random/srand">srand</a></td></tr></table>
</td></tr>
<tr><td colspan="5"> <table class="t-sb-list-ln-table"><tr><td><a href="random/RAND_MAX.html" title="cpp/numeric/random/RAND MAX">RAND_MAX</a></td></tr></table>
</td></tr>
</table>
</div></div></div>
</div>
<div class="t-navbar-sep"> </div>
</div>
<p>The random number library provides a set of generator engines (both pseudo-random number generators, which generate integer sequences with a uniform distribution, and true random number generators if available) and a set of random number distribution classes which convert the uniform distribution of the generator engines into various statistical distributions.
</p>
<p>All of the generator engines may be specifically seeded, serialized, and deserialized for use with repeatable simulators.
</p>
<table id="toc" class="toc"><tr><td>
<div id="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Random_number_engines"><span class="tocnumber">1</span> <span class="toctext">Random number engines</span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#Random_number_engine_adaptors"><span class="tocnumber">2</span> <span class="toctext">Random number engine adaptors</span></a></li>
<li class="toclevel-1 tocsection-3"><a href="#Predefined_random_number_generators"><span class="tocnumber">3</span> <span class="toctext">Predefined random number generators</span></a></li>
<li class="toclevel-1 tocsection-4">
<a href="#Random_number_distributions"><span class="tocnumber">4</span> <span class="toctext">Random number distributions</span></a>
<ul>
<li class="toclevel-2"><a href="#Uniform_distributions"><span class="tocnumber">4.1</span> <span class="toctext">Uniform distributions</span></a></li>
<li class="toclevel-2"><a href="#Bernoulli_distributions"><span class="tocnumber">4.2</span> <span class="toctext">Bernoulli distributions</span></a></li>
<li class="toclevel-2"><a href="#Poisson_distributions"><span class="tocnumber">4.3</span> <span class="toctext">Poisson distributions</span></a></li>
<li class="toclevel-2"><a href="#Normal_distributions"><span class="tocnumber">4.4</span> <span class="toctext">Normal distributions</span></a></li>
<li class="toclevel-2"><a href="#Sampling_distributions"><span class="tocnumber">4.5</span> <span class="toctext">Sampling distributions</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-5"><a href="#Predefined_seed_sequence_generators"><span class="tocnumber">5</span> <span class="toctext">Predefined seed sequence generators</span></a></li>
<li class="toclevel-1 tocsection-6"><a href="#C_library"><span class="tocnumber">6</span> <span class="toctext">C library</span></a></li>
</ul>
</td></tr></table>
<h3>
<span class="editsection">[<a href="http://en.cppreference.com/mwiki/index.php?title=cpp/numeric/random&amp;action=edit&amp;section=1" title="Edit section: Random number engines">edit</a>]</span> <span class="mw-headline" id="Random_number_engines">Random number engines</span>
</h3>
<p>Random number engines generate pseudo-random numbers using seed data as entropy source. Several different classes of pseudo-random number generation algorithms are implemented as templates that can be customized.
</p>
<p>The choice of which engine to use involves a number of tradeoffs:  the linear congruential engine is moderately fast and has a very small storage requirement for state.  The lagged Fibonacci generators are very fast even on processors without advanced arithmetic instruction sets, at the expense of greater state storage and sometimes less desirable spectral characteristics.  The Mersenne twister is slower and has greater state storage requirements but with the right parameters has the longest non-repeating sequence with the most desirable spectral characteristics (for a given definition of desirable).
</p>
<table class="t-dcl-list-begin">
<tr class="t-dcl-list-header"><td colspan="2"> <div>Defined in header <tt>&lt;random&gt;</tt> </div>
</td></tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/linear_congruential_engine.html" title="cpp/numeric/random/linear congruential engine"> linear_congruential_engine</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   implements <a href="http://en.wikipedia.com/wiki/Linear_congruential_generator" class="extiw" title="enwiki:Linear congruential generator"> linear congruential</a> algorithm  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/mersenne_twister_engine.html" title="cpp/numeric/random/mersenne twister engine"> mersenne_twister_engine</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   implements <a href="http://en.wikipedia.com/wiki/Mersenne_twister" class="extiw" title="enwiki:Mersenne twister"> Mersenne twister</a> algorithm  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/subtract_with_carry_engine.html" title="cpp/numeric/random/subtract with carry engine"> subtract_with_carry_engine</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   implements subtract with carry (a <a href="http://en.wikipedia.com/wiki/Lagged_Fibonacci_generator" class="extiw" title="enwiki:Lagged Fibonacci generator"> lagged Fibonacci</a>) algorithm  <br><span class="t-mark">(class template)</span>
</td>
</tr>
</table>
<h3>
<span class="editsection">[<a href="http://en.cppreference.com/mwiki/index.php?title=cpp/numeric/random&amp;action=edit&amp;section=2" title="Edit section: Random number engine adaptors">edit</a>]</span> <span class="mw-headline" id="Random_number_engine_adaptors">Random number engine adaptors</span>
</h3>
<p>Random number engine adaptors generate pseudo-random numbers using another random number engine as entropy source.  They are generally used to alter the spectral characteristics of the underlying engine.
</p>
<table class="t-dcl-list-begin">
<tr class="t-dcl-list-header"><td colspan="2"> <div>Defined in header <tt>&lt;random&gt;</tt> </div>
</td></tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/discard_block_enginehtml.html" title="cpp/numeric/random/discard block engine"> discard_block_engine</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   discards some output of a random number engine  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/independent_bits_engine.html" title="cpp/numeric/random/independent bits engine"> independent_bits_engine</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   packs the output of a random number engine into blocks of specified number of bits  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/shuffle_order_engine.html" title="cpp/numeric/random/shuffle order engine"> shuffle_order_engine</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   delivers the output of a random number engine in different order  <br><span class="t-mark">(class template)</span>
</td>
</tr>
</table>
<h3>
<span class="editsection">[<a href="http://en.cppreference.com/mwiki/index.php?title=cpp/numeric/random&amp;action=edit&amp;section=3" title="Edit section: Predefined random number generators">edit</a>]</span> <span class="mw-headline" id="Predefined_random_number_generators">Predefined random number generators</span>
</h3>
<p>Several specific popular algorithms are predefined.
</p>
<table class="t-dcl-list-begin">
<tr class="t-dcl-list-header"><td colspan="2"> <div>Defined in header <tt>&lt;random&gt;</tt> </div>
</td></tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-hitem">
<td>  Type
</td>
<td>  Definition
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <tt>minstd_rand0</tt>
</td>
<td>  <span class="mw-geshi cpp source-cpp"><a href="random/linear_congruential_engine.html"><span class="kw1170">std::<span class="me2">linear_congruential_engine</span></span></a><span class="sy1">&lt;</span>uint_fast32_t, <span class="nu0">16807</span>, <span class="nu0">0</span>, <span class="nu0">2147483647</span><span class="sy1">&gt;</span></span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <tt>minstd_rand</tt>
</td>
<td>  <span class="mw-geshi cpp source-cpp"><a href="random/linear_congruential_engine.html"><span class="kw1170">std::<span class="me2">linear_congruential_engine</span></span></a><span class="sy1">&lt;</span>uint_fast32_t, <span class="nu0">48271</span>, <span class="nu0">0</span>, <span class="nu0">2147483647</span><span class="sy1">&gt;</span></span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <tt>mt19937</tt>
</td>
<td>  <span class="mw-geshi cpp source-cpp"><a href="random/mersenne_twister_engine.html"><span class="kw1171">std::<span class="me2">mersenne_twister_engine</span></span></a><span class="sy1">&lt;</span>uint_fast32_t, <span class="nu0">32</span>, <span class="nu0">624</span>, <span class="nu0">397</span>, <span class="nu0">31</span>, <br><p>                             <span class="nu12">0x9908b0df</span>, <span class="nu0">11</span>, <br>
                             <span class="nu12">0xffffffff</span>, <span class="nu0">7</span>, <br>
                             <span class="nu12">0x9d2c5680</span>, <span class="nu0">15</span>, <br>
                             <span class="nu12">0xefc60000</span>, <span class="nu0">18</span>, <span class="nu0">1812433253</span><span class="sy1">&gt;</span></p></span>

</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <tt>mt19937_64</tt>
</td>
<td>  <span class="mw-geshi cpp source-cpp"><a href="random/mersenne_twister_engine.html"><span class="kw1171">std::<span class="me2">mersenne_twister_engine</span></span></a><span class="sy1">&lt;</span>uint_fast64_t, <span class="nu0">64</span>, <span class="nu0">312</span>, <span class="nu0">156</span>, <span class="nu0">31</span>,<br><p>                             <span class="nu12">0xb5026f5aa96619e9</span>, <span class="nu0">29</span>,<br>
                             <span class="nu12">0x5555555555555555</span>, <span class="nu0">17</span>,<br>
                             <span class="nu12">0x71d67fffeda60000</span>, <span class="nu0">37</span>,<br>
                             <span class="nu12">0xfff7eee000000000</span>, <span class="nu0">43</span>, <span class="nu0">6364136223846793005</span><span class="sy1">&gt;</span></p></span>

</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <tt>ranlux24_base</tt>
</td>
<td>  <span class="mw-geshi cpp source-cpp"><a href="random/subtract_with_carry_engine.html"><span class="kw1172">std::<span class="me2">subtract_with_carry_engine</span></span></a><span class="sy1">&lt;</span>uint_fast32_t, <span class="nu0">24</span>, <span class="nu0">10</span>, <span class="nu0">24</span><span class="sy1">&gt;</span></span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <tt>ranlux48_base</tt>
</td>
<td>  <span class="mw-geshi cpp source-cpp"><a href="random/subtract_with_carry_engine.html"><span class="kw1172">std::<span class="me2">subtract_with_carry_engine</span></span></a><span class="sy1">&lt;</span>uint_fast64_t, <span class="nu0">48</span>, <span class="nu0">5</span>, <span class="nu0">12</span><span class="sy1">&gt;</span></span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <tt>ranlux24</tt>
</td>
<td>  <span class="mw-geshi cpp source-cpp"><a href="random/discard_block_enginehtml.html"><span class="kw1173">std::<span class="me2">discard_block_engine</span></span></a><span class="sy1">&lt;</span>ranlux24_base, <span class="nu0">223</span>, <span class="nu0">23</span><span class="sy1">&gt;</span></span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <tt>ranlux48</tt>
</td>
<td>  <span class="mw-geshi cpp source-cpp"><a href="random/discard_block_enginehtml.html"><span class="kw1173">std::<span class="me2">discard_block_engine</span></span></a><span class="sy1">&lt;</span>ranlux48_base, <span class="nu0">389</span>, <span class="nu0">11</span><span class="sy1">&gt;</span></span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <tt>knuth_b</tt>
</td>
<td>  <span class="mw-geshi cpp source-cpp"><a href="random/shuffle_order_engine.html"><span class="kw1175">std::<span class="me2">shuffle_order_engine</span></span></a><span class="sy1">&lt;</span>minstd_rand0, <span class="nu0">256</span><span class="sy1">&gt;</span></span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <tt>default_random_engine</tt>
</td>
<td>  <i>implementation-defined</i>
</td>
</tr>
</table>
<table class="t-dcl-list-begin">
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div"><div><a href="random/random_devicehtml.html" title="cpp/numeric/random/random device"> random_device</a></div></div>
</td>
<td>   non-deterministic random number generator using hardware entropy source  <br><span class="t-mark">(class)</span>
</td>
</tr>
</table>
<h3>
<span class="editsection">[<a href="http://en.cppreference.com/mwiki/index.php?title=cpp/numeric/random&amp;action=edit&amp;section=4" title="Edit section: Random number distributions">edit</a>]</span> <span class="mw-headline" id="Random_number_distributions">Random number distributions</span>
</h3>
<p>Random number distributions are post-process the output of an random number engine or adaptors in such a way that resulting output is distributed on a defined statistical probability density function.
</p>
<table class="t-dcl-list-begin">
<tr class="t-dcl-list-header"><td colspan="2"> <div>Defined in header <tt>&lt;random&gt;</tt> </div>
</td></tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr><td colspan="2"> <h5> <span class="mw-headline" id="Uniform_distributions">  Uniform distributions </span>
</h5>
</td></tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/uniform_int_distribution.html" title="cpp/numeric/random/uniform int distribution"> uniform_int_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces integer values evenly distributed across a range  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/uniform_real_distribution.html" title="cpp/numeric/random/uniform real distribution"> uniform_real_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces real values evenly distributed across a range  <br><span class="t-mark">(class template)</span> 
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/generate_canonicalhtml.html" title="cpp/numeric/random/generate canonical"> generate_canonical</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   evenly distributes real values of given precision across [0, 1)  <br><span class="t-mark">(function template)</span> 
</td>
</tr>
<tr><td colspan="2"> <h5> <span class="mw-headline" id="Bernoulli_distributions">  Bernoulli distributions </span>
</h5>
</td></tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/bernoulli_distribution.html" title="cpp/numeric/random/bernoulli distribution"> bernoulli_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces <span class="mw-geshi cpp source-cpp"><span class="kw4">bool</span></span> values on a <a href="http://en.wikipedia.com/wiki/Bernoulli_distribution" class="extiw" title="enwiki:Bernoulli distribution"> Bernoulli distribution</a>.  <br><span class="t-mark">(class)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/binomial_distribution.html" title="cpp/numeric/random/binomial distribution"> binomial_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces integer values on a  <a href="http://en.wikipedia.com/wiki/Binomial_distribution" class="extiw" title="enwiki:Binomial distribution"> binomial distribution</a>.   <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/negative_binomial_distributionhtml.html" title="cpp/numeric/random/negative binomial distribution"> negative_binomial_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces integer values on a  <a href="http://en.wikipedia.com/wiki/Negative_binomial_distribution" class="extiw" title="enwiki:Negative binomial distribution"> negative binomial distribution</a>.   <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/geometric_distribution.html" title="cpp/numeric/random/geometric distribution"> geometric_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces integer values on a  <a href="http://en.wikipedia.com/wiki/Geometric_distribution" class="extiw" title="enwiki:Geometric distribution"> geometric distribution</a>.   <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2"> <h5> <span class="mw-headline" id="Poisson_distributions">  Poisson distributions </span>
</h5>
</td></tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/poisson_distribution.html" title="cpp/numeric/random/poisson distribution"> poisson_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces integer values on a  <a href="http://en.wikipedia.com/wiki/Poisson_distribution" class="extiw" title="enwiki:Poisson distribution"> poisson distribution</a>.  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/exponential_distributionhtml.html" title="cpp/numeric/random/exponential distribution"> exponential_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces real values on an  <a href="http://en.wikipedia.com/wiki/Exponential_distribution" class="extiw" title="enwiki:Exponential distribution"> exponential distribution</a>.  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/gamma_distribution.html" title="cpp/numeric/random/gamma distribution"> gamma_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces real values on an  <a href="http://en.wikipedia.com/wiki/Gamma_distribution" class="extiw" title="enwiki:Gamma distribution"> gamma distribution</a>.  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/weibull_distribution.html" title="cpp/numeric/random/weibull distribution"> weibull_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>  produces real values on a  <a href="http://en.wikipedia.com/wiki/Weibull_distribution" class="extiw" title="enwiki:Weibull distribution"> Weibull distribution</a>.  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/extreme_value_distribution.html" title="cpp/numeric/random/extreme value distribution"> extreme_value_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces real values on an  <a href="http://en.wikipedia.com/wiki/Generalized_extreme_value_distribution" class="extiw" title="enwiki:Generalized extreme value distribution"> extreme value distribution</a>.  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2"> <h5> <span class="mw-headline" id="Normal_distributions">  Normal distributions </span>
</h5>
</td></tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/normal_distributionhtml.html" title="cpp/numeric/random/normal distribution"> normal_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces real values on a  <a href="http://en.wikipedia.com/wiki/Normal_distribution" class="extiw" title="enwiki:Normal distribution"> standard normal (Gaussian) distribution</a>.  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/lognormal_distribution.html" title="cpp/numeric/random/lognormal distribution"> lognormal_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces real values on a  <a href="http://en.wikipedia.com/wiki/Lognormal_distribution" class="extiw" title="enwiki:Lognormal distribution"> lognormal distribution</a>.  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/chi_squared_distribution.html" title="cpp/numeric/random/chi squared distribution"> chi_squared_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces real values on a  <a href="http://en.wikipedia.com/wiki/Chi-squared_distribution" class="extiw" title="enwiki:Chi-squared distribution"> chi-squared distribution</a>.   <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/cauchy_distributionhtml.html" title="cpp/numeric/random/cauchy distribution"> cauchy_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces real values on a  <a href="http://en.wikipedia.com/wiki/Cauchy_distribution" class="extiw" title="enwiki:Cauchy distribution"> Cauchy distribution</a>.  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/fisher_f_distribution.html" title="cpp/numeric/random/fisher f distribution"> fisher_f_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces real values on a  <a href="http://en.wikipedia.com/wiki/F-distribution" class="extiw" title="enwiki:F-distribution"> Fisher's F-distribution</a>.  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/student_t_distribution.html" title="cpp/numeric/random/student t distribution"> student_t_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces real values on a  <a href="http://en.wikipedia.com/wiki/Student%27s_t-distribution" class="extiw" title="enwiki:Student's t-distribution"> Student's t-distribution</a>.  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2"> <h5> <span class="mw-headline" id="Sampling_distributions">  Sampling distributions </span>
</h5>
</td></tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/discrete_distributionhtml.html" title="cpp/numeric/random/discrete distribution"> discrete_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces random integers on a discrete distribution.  <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/piecewise_constant_distribution.html" title="cpp/numeric/random/piecewise constant distribution"> piecewise_constant_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces real values distributed on constant subintervals. <br><span class="t-mark">(class template)</span>
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/piecewise_linear_distribution.html" title="cpp/numeric/random/piecewise linear distribution"> piecewise_linear_distribution</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   produces real values distributed on defined subintervals.  <br><span class="t-mark">(class template)</span>
</td>
</tr>
</table>
<h3>
<span class="editsection">[<a href="http://en.cppreference.com/mwiki/index.php?title=cpp/numeric/random&amp;action=edit&amp;section=5" title="Edit section: Predefined seed sequence generators">edit</a>]</span> <span class="mw-headline" id="Predefined_seed_sequence_generators">Predefined seed sequence generators</span>
</h3>
<table class="t-dcl-list-begin">
<tr class="t-dcl-list-header"><td colspan="2"> <div>Defined in header <tt>&lt;random&gt;</tt> </div>
</td></tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div">
<div><a href="random/seed_seqhtml.html" title="cpp/numeric/random/seed seq"> seed_seq</a></div>
<div><span class="t-mark">(C++11)</span></div>
</div>
</td>
<td>   general-purpose bias-eliminating scrambled seed sequence generator  <br><span class="t-mark">(class)</span>
</td>
</tr>
</table>
<h3>
<span class="editsection">[<a href="http://en.cppreference.com/mwiki/index.php?title=cpp/numeric/random&amp;action=edit&amp;section=6" title="Edit section: C library">edit</a>]</span> <span class="mw-headline" id="C_library">C library</span>
</h3>
<table class="t-dcl-list-begin">
<tr class="t-dcl-list-header"><td colspan="2"> <div>Defined in header <tt>&lt;cstdlib&gt;</tt> </div>
</td></tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div"><div><a href="random/rand.html" title="cpp/numeric/random/rand"> rand</a></div></div>
</td>
<td>   generates a pseudo-random number  <br><span class="t-mark">(function)</span> 
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div"><div><a href="random/srand.html" title="cpp/numeric/random/srand"> srand</a></div></div>
</td>
<td>   initializes pseudo-random number generator <br><span class="t-mark">(function)</span> 
</td>
</tr>
<tr><td colspan="2" class="t-dcl-list-sep">
</td></tr>
<tr class="t-dcl-list-item">
<td>  <div class="t-dcl-member-div"><div><a href="random/RAND_MAX.html" title="cpp/numeric/random/RAND MAX"> RAND_MAX</a></div></div>
</td>
<td>   maximum possible value generated by <span class="mw-geshi cpp source-cpp"><a href="random/rand.html"><span class="kw1187">std::<span class="me2">rand</span></span></a></span> <br><span class="t-mark">(macro constant)</span> 
</td>
</tr>
</table>
<!-- 
NewPP limit report
Preprocessor node count: 5320/1000000
Post-expand include size: 163549/2097152 bytes
Template argument size: 66776/2097152 bytes
Expensive parser function count: 0/100
--><!-- Saved in parser cache with key mwiki1-mwiki_en_:pcache:idhash:2063-0!*!0!!en!*!* and timestamp 20120615235324 -->
</div>                    <!-- /bodycontent -->
                                        <!-- printfooter -->
                    <div class="printfooter">
                    Retrieved from "<a href="http://en.cppreference.com/mwiki/index.php?title=cpp/numeric/random&amp;oldid=34429">http://en.cppreference.com/mwiki/index.php?title=cpp/numeric/random&amp;oldid=34429</a>"                    </div>
                    <!-- /printfooter -->
                                                            <!-- catlinks -->
                    <div id="catlinks" class="catlinks catlinks-allhidden"></div>                    <!-- /catlinks -->
                                                            <div class="visualClear"></div>
                    <!-- debughtml -->
                                        <!-- /debughtml -->
                </div>
                <!-- /bodyContent -->
            </div>
        </div>
        <!-- /content -->
        <!-- footer -->
        
        <!-- /footer -->
        <script src="../../../common/loadac2a.php?debug=false&amp;lang=en&amp;modules=skins.cppreference2&amp;only=scripts&amp;skin=cppreference2&amp;*"></script><script>if(window.mw){
	mw.loader.load(["mediawiki.user", "mediawiki.util", "mediawiki.page.ready", "mediawiki.legacy.wikibits", "mediawiki.legacy.ajax"]);
}
</script><script src="../../../common/load345b.php?debug=false&amp;lang=en&amp;modules=site&amp;only=scripts&amp;skin=cppreference2&amp;*"></script><script>if(window.mw){
	mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"disablesuggest":0,"editfont":"default","editondblclick":0,"editsection":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":0,"extendwatchlist":0,"externaldiff":0,"externaleditor":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"highlightbroken":1,"imagesize":2,"justify":0,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nocache":0,"noconvertlink":0,"norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"quickbar":5,"rcdays":7,"rclimit":50,"rememberpassword":0,"rows":25,"searchlimit":20,"showhiddencats":0,"showjumplinks":1,"shownumberswatching":1,"showtoc":0,"showtoolbar":1,"skin":"cppreference2","stubthreshold":0,"thumbsize":2,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":0,"watchdefault":0,"watchdeletion":0,"watchlistdays":3,"watchlisthideanons":0
	,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,"variant":"en","language":"en","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false});;mw.user.tokens.set({"editToken":"+\\","watchToken":false});;mw.loader.state({"user.options":"ready","user.tokens":"ready"});
	
	/* cache key: mwiki1-mwiki_en_:resourceloader:filter:minify-js:4:3740695a1552aee37d594967bd36f869 */
}
</script><script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
var pageTracker = _gat._getTracker("UA-2828341-1");
pageTracker._trackPageview();
</script><!-- Served in 2.835 secs. -->
</body>
<!-- Cached 20120615235325 -->
</html>
