isprime.pod

来自「支持SSL v2/v3, TLS, PKCS #5, PKCS #7, PKCS」· POD 代码 · 共 63 行

POD
63
字号
=head1 NAME isprime - probabilistic primality testing=head1 SYNOPSIS isprime <a>=head1 DESCRIPTIONThe B<isprime> program attempts to determine whether the arbitraryprecision integer I<a> is prime.  It first tests I<a> for divisibilityby the first 170 or so small primes, and assuming I<a> is notdivisible by any of these, applies 15 iterations of the Rabin-Millerprobabilistic primality test.If the program discovers that the number is composite, it will print: Not prime (reason)Where I<reason> is either:	divisible by small prime xOr:	failed nth pseudoprime testIn the first case, I<x> indicates the first small prime factor thatwas found.  In the second case, I<n> indicates which of thepseudoprime tests failed (numbered from 1)If this happens, the number is definitely not prime.  However, if thenumber succeeds, this message results: Probably prime, 1 in 4^15 chance of false positiveIf this happens, the number is prime with very high probability, butits primality has not been absolutely proven, only demonstrated to avery convincing degree.The value I<a> can be input in standard decimal notation, or, if it isprefixed with I<Ox>, it will be read as hexadecimal.=head1 ENVIRONMENTYou can control how many iterations of Rabin-Miller are performed onthe candidate number by setting the I<RM_TESTS> environment variableto an integer value before starting up B<isprime>.  This will changethe output slightly if the number passes all the tests.=head1 SEE ALSOgcd(1), invmod(1), lap(1)=head1 AUTHOR Michael J. Fromberger <sting@linguist.dartmouth.edu> Thayer School of Engineering, Hanover, New Hampshire, USA  $Date: 2000/07/14 00:44:33 $

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?