in reply to Re^6: OT: Finding Factor Closest To Square Root
in thread OT: Finding Factor Closest To Square Root
If you haven't already installed Math::Pari for doing your factorisation, do so now. I knew it would be quicker than Math::Big, but you have to see for yourself how much faster it is to believe it. It's not just the C -v- Perl difference, it has a batch of extremely clever algorithms in there, and intelligently chooses the most appropriate one.
The only bug-bear I have with Math::Pari so far, is the lack of a (as far as I can see), function for flattening its two dimensional vectors. The results from factorint() come back as an AoA, where the first nested array conatins the factors, and the second contains the counts, which makes them a tad awkward to maniulate.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^8: OT: Finding Factor Closest To Square Root
by hv (Prior) on Feb 22, 2005 at 12:39 UTC | |
by BrowserUk (Patriarch) on Feb 22, 2005 at 19:00 UTC |