Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^8: Number functions.. primes (ugly code runs faster)

by Anonymous Monk
on May 08, 2015 at 01:20 UTC ( #1126043=note: print w/replies, xml ) Need Help??

in reply to Re^7: Number functions.. primes (ugly code runs faster)
in thread Number functions I have lying around

Regarding memory use: the result array footprint probably outweighs the sieve for limits up to 1014.

Re: code. m//gogo is the sole bit of artistic liberty (or wishful thinking) and can be shortened to just //g. And sure, you're welcome to it, to work on it or repost it. An anonymonk couldn't say no, anyhow.

Replies are listed 'Best First'.
Re^9: Number functions.. primes (ugly code runs faster)
by danaj (Friar) on May 08, 2015 at 03:33 UTC

    On memory footprint, it's important if using it for just the count where there is no array. Also for cases where we hold onto the string for later use in walking primes without resieving or storing the array. However, even doubling the string memory still results in >10x less memory than the array versions.

    Thanks re posting. Given the licensing, I thought it was prudent to ask.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1126043]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2022-05-27 02:42 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (94 votes). Check out past polls.