<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.random-engine-pcgoneseq128xslrr64.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'random-engine-pcgoneseq128xslrr64.jump.php',
    1 => 'Random\\Engine\\PcgOneseq128XslRr64::jump',
    2 => 'Efficiently move the engine ahead multiple steps',
  ),
  'up' => 
  array (
    0 => 'class.random-engine-pcgoneseq128xslrr64.php',
    1 => 'Random\\Engine\\PcgOneseq128XslRr64',
  ),
  'prev' => 
  array (
    0 => 'random-engine-pcgoneseq128xslrr64.generate.php',
    1 => 'Random\\Engine\\PcgOneseq128XslRr64::generate',
  ),
  'next' => 
  array (
    0 => 'random-engine-pcgoneseq128xslrr64.serialize.php',
    1 => 'Random\\Engine\\PcgOneseq128XslRr64::__serialize',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/random/random/engine/pcgoneseq128xslrr64/jump.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="random-engine-pcgoneseq128xslrr64.jump" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Random\Engine\PcgOneseq128XslRr64::jump</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.2.0)</p><p class="refpurpose"><span class="refname">Random\Engine\PcgOneseq128XslRr64::jump</span> &mdash; <span class="dc-title">Efficiently move the engine ahead multiple steps</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-random-engine-pcgoneseq128xslrr64.jump-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Random\Engine\PcgOneseq128XslRr64::jump</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$advance</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="para rdfs-comment">
   Moves the algorithm’s state ahead by the number of steps given by <code class="parameter">advance</code>, as if
   <span class="function"><a href="random-engine-pcgoneseq128xslrr64.generate.php" class="function">Random\Engine\PcgOneseq128XslRr64::generate()</a></span> was called that many times.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-random-engine-pcgoneseq128xslrr64.jump-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">advance</code></dt>
    <dd>
     <p class="para">
      The number of steps to move ahead; must be <code class="literal">0</code> or greater.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-random-engine-pcgoneseq128xslrr64.jump-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   No value is returned.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-random-engine-pcgoneseq128xslrr64.jump-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     If <code class="parameter">advance</code> is less than <code class="literal">0</code>,
     a <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> will be thrown.
    </span>
   </li>
  </ul>
 </div>


 <div class="refsect1 examples" id="refsect1-random-engine-pcgoneseq128xslrr64.jump-examples">
  <h3 class="title">Examples</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 <span class="function"><strong>Random\Engine\PcgOneseq128XslRr64::jump()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$a </span><span style="color: #007700">= new </span><span style="color: #0000BB">\Random\Engine\PcgOneseq128XslRr64</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$b </span><span style="color: #007700">= clone </span><span style="color: #0000BB">$a</span><span style="color: #007700">;<br /><br />for (</span><span style="color: #0000BB">$i </span><span style="color: #007700">= </span><span style="color: #0000BB">0</span><span style="color: #007700">; </span><span style="color: #0000BB">$i </span><span style="color: #007700">&lt; </span><span style="color: #0000BB">1_000</span><span style="color: #007700">; </span><span style="color: #0000BB">$i</span><span style="color: #007700">++) {<br />    </span><span style="color: #0000BB">$a</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">generate</span><span style="color: #007700">();<br />}<br /></span><span style="color: #0000BB">$b</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">jump</span><span style="color: #007700">(</span><span style="color: #0000BB">1_000</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #DD0000">"A: "</span><span style="color: #007700">, </span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">generate</span><span style="color: #007700">()), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"B: "</span><span style="color: #007700">, </span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">$b</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">generate</span><span style="color: #007700">()), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>The above example will output:</p></div>
   <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">A: e6d0d5813913a424
B: e6d0d5813913a424</pre>
</div>
   </div>
  </div>
  <div class="example" id="example-2">
   <p><strong>Example #2 Randomizer methods may call the engine more than once</strong></p>
   <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$a </span><span style="color: #007700">= new </span><span style="color: #0000BB">\Random\Randomizer</span><span style="color: #007700">(new </span><span style="color: #0000BB">\Random\Engine\PcgOneseq128XslRr64</span><span style="color: #007700">(</span><span style="color: #0000BB">42659</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$b </span><span style="color: #007700">= new </span><span style="color: #0000BB">\Random\Randomizer</span><span style="color: #007700">(clone </span><span style="color: #0000BB">$a</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">engine</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$a</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getInt</span><span style="color: #007700">(</span><span style="color: #0000BB">1</span><span style="color: #007700">, </span><span style="color: #0000BB">1572864</span><span style="color: #007700">); </span><span style="color: #FF8000">// Performs two calls to generate().<br /></span><span style="color: #0000BB">$a</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getInt</span><span style="color: #007700">(</span><span style="color: #0000BB">1</span><span style="color: #007700">, </span><span style="color: #0000BB">1572864</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$b</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">engine</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">jump</span><span style="color: #007700">(</span><span style="color: #0000BB">2</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Because the first call to -&gt;getInt() called -&gt;generate() twice<br />// the engines do not match up after performing a -&gt;jump(2).<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"A: "</span><span style="color: #007700">, </span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">engine</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">generate</span><span style="color: #007700">()), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"B: "</span><span style="color: #007700">, </span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">$b</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">engine</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">generate</span><span style="color: #007700">()), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Now the B engine matches the A engine.<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"B: "</span><span style="color: #007700">, </span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">$b</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">engine</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">generate</span><span style="color: #007700">()), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>The above example will output:</p></div>
   <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">A: 1e9f3107d56653d0
B: a156c0086dd79d44
B: 1e9f3107d56653d0</pre>
</div>
   </div>
  </div>
 </div>



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