Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 4389

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Combined linear congruential generator</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.is-nan.html">is_nan</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.log10.html">log10</a></div>
 <div class="up"><a href="ref.math.html">Math Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.lcg-value" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">lcg_value</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">lcg_value</span> &mdash; <span class="dc-title">Combined linear congruential generator</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.lcg-value-description">
  <h3 class="title">Description</h3>
   <div class="methodsynopsis dc-description">
    <span class="type">float</span> <span class="methodname"><strong>lcg_value</strong></span>
     ( <span class="methodparam">void</span>
    )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>lcg_value()</strong></span> returns a pseudo random number in
   the range of (0, 1).  The function combines two CGs with periods
   of 2^31 - 85 and 2^31 - 249. The period of this function is equal
   to the product of both primes.
  </p>
  <div class="caution"><strong class="caution">Caution</strong><p class="para">This function does not
generate cryptographically secure values, and should not be used for cryptographic purposes. If you need a
cryptographically secure value, consider using <span class="function"><a href="function.random-int.html" class="function">random_int()</a></span>, <span class="function"><a href="function.random-bytes.html" class="function">random_bytes()</a></span>, or
<span class="function"><a href="function.openssl-random-pseudo-bytes.html" class="function">openssl_random_pseudo_bytes()</a></span> instead.</p></div>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.lcg-value-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   A pseudo random float value between 0.0 and 1.0, inclusive.
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.lcg-value-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.rand.html" class="function" rel="rdfs-seeAlso">rand()</a> - Generate a random integer</span></li>
    <li class="member"><span class="function"><a href="function.mt-rand.html" class="function" rel="rdfs-seeAlso">mt_rand()</a> - Generate a random value via the Mersenne Twister Random Number Generator</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.is-nan.html">is_nan</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.log10.html">log10</a></div>
 <div class="up"><a href="ref.math.html">Math Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>