Subject: | Bug with Math-Factor-XS-0.37 and prime numbers |
Date: | Fri, 15 Jan 2010 19:18:58 +0100 |
To: | bug-Math-Factor-XS [...] rt.cpan.org |
From: | Tom Scheper <scheper [...] gmail.com> |
When attempting to get the factors of a prime number, the module dies
with the following error:
Parameter #2 ("ARRAY(0x8198098)") to Math::Factor::XS::matches did not
pass the 'factors are positive numbers' callback
The expected behaviour would be getting the only factor, the number
itself, returned.
Example code:
use strict;
use warnings;
use Math::Factor::XS ':all';
my $n = 5;
my @factors = factors( $n);
my @matches = matches( $n, \@factors);