in reply to Re^7: OT: Finding Factor Closest To Square Root
in thread OT: Finding Factor Closest To Square Root
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 manipulate.
That second arrayref would be a perfect list of counts to be handing to Algorithm::Loops::NestedLoops though. :)
The obvious alternative (used by some other packages I've tried) would be to return 2250 = [ [ 2, 1 ], [ 3, 2 ], [ 5, 3 ] ] instead of [ [ 2, 3, 5 ], [ 1, 2, 3 ] ], but in general I've found the two forms equally easy to work with for most things.
Hugo
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^9: OT: Finding Factor Closest To Square Root
by BrowserUk (Patriarch) on Feb 22, 2005 at 19:00 UTC |