autodoc.git / traditional_manual / chapter_21.html

version» Context lines:

autodoc.git/traditional_manual/chapter_21.html:24792:   <dt class='head--doc'>Throws</dt>   <dd class='body--doc'><p>An error is thrown if no inverse exists.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span>   <span class='homogen--name'><b>next_prime</b></span>   </dt> - <dd><p><code><code class='object unresolved'>Gmp.mpz</code> <b><span class='method'>next_prime</span>(</b><code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>count</code>, <code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>limit</code><b>)</b></code></p></dd> - </dl> + <dd><p><code><code class='object unresolved'>Gmp.mpz</code> <b><span class='method'>next_prime</span>(</b><b>)</b></code></p></dd>    -  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Returns the next higher prime for positive numbers and the next +  lower for negative.</p> + </dd> + <dt class='head--doc'><span id='p-count'></span>Parameter <code class='parameter'>count</code></dt> + <dd></dd><dd class='body--doc'><p>The prime number testing is using Donald Knuth's probabilistic +  primality test. The chance for a false positive is pow(0.25,25).</p> + </dd></dl>    -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span>   <span class='homogen--name'><b>popcount</b></span>   </dt>   <dd><p><code><code class='datatype'>int</code> <b><span class='method'>popcount</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt>   <dd class='body--doc'><p>For values &gt;= 0, returns the population count (the number of set bits).    For negative values (who have an infinite number of leading ones in a
autodoc.git/traditional_manual/chapter_21.html:24846:   <dt class='head--doc'>See also</dt>   <dd class='body--doc'><p><code>pow</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span>   <span class='homogen--name'><b>probably_prime_p</b></span>   </dt> - <dd><p><code><code class='datatype'>bool</code> <b><span class='method'>probably_prime_p</span>(</b><code class='datatype'>int</code> <code class='argument'>count</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int(0..2)</code> <b><span class='method'>probably_prime_p</span>(</b><code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>count</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Return 1 if this mpz object is a prime, and 0 most of the time if -  it is not.</p> + <dd class='body--doc'><p>Return 2 if this mpz object is a prime, 1 if it probably is a +  prime, and 0 if it definitely is not a prime. Testing values below +  1000000 will only return 2 or 0.</p>   </dd>   <dt class='head--doc'><span id='p-count'></span>Parameter <code class='parameter'>count</code></dt>   <dd></dd><dd class='body--doc'><p>The prime number testing is using Donald Knuth's probabilistic    primality test. The chance for a false positive is -  pow(0.25,count). The higher value, the more probable it is that -  the number is a prime. Default value is 25.</p> +  pow(0.25,count). Default value is 25 and resonable values are +  between 15 and 50.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span>   <span class='homogen--name'><b>sgn</b></span>   </dt>   <dd><p><code><code class='datatype'>int</code> <b><span class='method'>sgn</span>(</b><b>)</b></code></p></dd>