Skip to content

Commit

Permalink
Add basic pod about is_aks_prime and add basic loading tests for AKS …
Browse files Browse the repository at this point in the history
…and BigPolynomial
  • Loading branch information
leto committed Sep 25, 2012
1 parent 3ec9032 commit 5c947f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/Math/Primality/AKS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ our %EXPORT_TAGS = ( all => \@EXPORT_OK );
=head1 FUNCTIONS
=head2 aks($n)
=head2 is_aks_prime($n)
Returns 1 if $n is an AKS prime, 0 if it is not.
=cut

Expand Down Expand Up @@ -121,6 +123,7 @@ sub is_aks_prime($) {

Math::Primality::BigPolynomial::mpz_poly_mod_power($res, $base, $n, $n, $intr);


if($res->isEqual($compare)) {
debug "Found not prime at $a\n";
return 0;
Expand Down
4 changes: 3 additions & 1 deletion t/00-load.t
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env perl
use strict;

use Test::More tests => 1;
use Test::More tests => 3;

BEGIN {
use_ok( 'Math::Primality' );
use_ok( 'Math::Primality::AKS' );
use_ok( 'Math::Primality::BigPolynomial' );
}

diag( "Testing Math::Primality $Math::Primality::VERSION, Perl $], $^X" );

0 comments on commit 5c947f0

Please sign in to comment.