Skip Menu |

This queue is for tickets about the Math-Factor-XS CPAN distribution.

Report information
The Basics
Id: 46870
Status: resolved
Priority: 0/
Queue: Math-Factor-XS

People
Owner: Nobody in particular
Requestors: jonathan [...] leto.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.35
Fixed in: (no value)



Subject: Factors() method checks up to n/2 instead of int(sqrt(n))
The trial division method algorithm of factors() checks numbers between int(sqrt(n)) and n/2 for factors of n. For instance, instead of checking up until 10 for factors of 100, it checks up to 50. This is wasted computation. The if statement in XS.xs for factors() should read something like if( i > int(sqrt(number)) ) break; Cheers,
Fixed in v0.35_02.