Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Locating a specified number of contiguous 0 bits within a large bitstring efficiently.

by BrowserUk (Pope)
on Jun 07, 2013 at 06:04 UTC ( #1037589=note: print w/replies, xml ) Need Help??


in reply to Re: Locating a specified number of contiguous 0 bits within a large bitstring efficiently.
in thread Locating a specified number of contiguous 0 bits within a large bitstring efficiently.

This works perfectly, and fairly quickly. Thankyou.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^2: Locating a specified number of contiguous 0 bits within a large bitstring efficiently.

Replies are listed 'Best First'.
Re^3: Locating a specified number of contiguous 0 bits within a large bitstring efficiently.
by wrog (Friar) on Jun 07, 2013 at 08:25 UTC
    I don't see how this can work for $N<8; in fact, it doesn't:
    match_0s(1,"\201\201\201\201") => -1

      Oops, thanks for catching that.

      I edited my previous post.

      Indeed. My benchmark code was using a random generator that was not producing values < 8. Now fixed. Thanks.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1037589]
help
Chatterbox?
[erix]: by his far-sightedness
[erix]: (oops, no dash)
[karlgoethebier]: isn't the earth flat?
[LanX]: kgb only when confirmed by Fox news

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2017-10-24 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (289 votes). Check out past polls.

    Notices?