<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.random.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.lcg-value.php',
    1 => 'lcg_value',
    2 => 'Combined linear congruential generator',
  ),
  'up' => 
  array (
    0 => 'ref.random.php',
    1 => 'Random Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.getrandmax.php',
    1 => 'getrandmax',
  ),
  'next' => 
  array (
    0 => 'function.mt-getrandmax.php',
    1 => 'mt_getrandmax',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/random/functions/lcg-value.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<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, PHP 8)</p><p class="refpurpose"><span class="refname">lcg_value</span> &mdash; <span class="dc-title">Combined linear congruential generator</span></p>

 </div>

 <div id="function.lcg-value-refsynopsisdiv">
  <div class="warning"><strong class="warning">Avviso</strong><p class="simpara">This function has been
<em>DEPRECATED</em> as of PHP 8.4.0. Relying on this function
is highly discouraged.</p></div>
 </div>

 <div class="refsect1 description" id="refsect1-function.lcg-value-description">
  <h3 class="title">Descrizione</h3>
   <div class="methodsynopsis dc-description">
   <span class="attribute"><a href="class.deprecated.php">#[\Deprecated]</a> </span><br>
   <span class="methodname"><strong>lcg_value</strong></span>(): <span class="type"><a href="language.types.float.php" class="type float">float</a></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">Attenzione</strong><p class="para">Questa funzione non genera valori crittograficamente sicuri, e non dovrebbe essere usata per scopi di crittografia. Se c&#039;è necessità di utilizzare un valore crittograficamente sicuro, si preferisca <span class="function"><a href="function.openssl-random-pseudo-bytes.php" class="function">openssl_random_pseudo_bytes()</a></span>.</p></div>
  <div class="caution"><strong class="caution">Attenzione</strong>
   <p class="para">
    Scaling the return value to a different interval using multiplication
    or addition (a so-called affine transformation) might result in a bias
    in the resulting value as floats are not equally dense across the number
    line. As not all values can be exactly represented by a float, the
    result of the affine transformation might also result in values outside
    of the requested interval.
   </p>
   <p class="para">
    Use <span class="methodname"><a href="random-randomizer.getfloat.php" class="methodname">Random\Randomizer::getFloat()</a></span> to generate a
    random float within an arbitrary interval. Use <span class="methodname"><a href="random-randomizer.getint.php" class="methodname">Random\Randomizer::getInt()</a></span>
    to generate a random integer within an arbitrary interval.
   </p>
  </div>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.lcg-value-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">Questa funzione non contiene parametri.</p>
 </div>


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


 <div class="refsect1 changelog" id="refsect1-function.lcg-value-changelog">
  <h3 class="title">Log delle modifiche</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versione</th>
      <th>Descrizione</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.4.0</td>
      <td>
       This function has been deprecated.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.lcg-value-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="random-randomizer.getfloat.php" class="methodname" rel="rdfs-seeAlso">Random\Randomizer::getFloat()</a> - Get a uniformly selected float</span></li>
    <li><span class="methodname"><a href="random-randomizer.getint.php" class="methodname" rel="rdfs-seeAlso">Random\Randomizer::getInt()</a> - Get a uniformly selected integer</span></li>
    <li><span class="function"><a href="function.random-int.php" class="function" rel="rdfs-seeAlso">random_int()</a> - Get a cryptographically secure, uniformly selected integer</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>