in reply to Re^2: 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.

I don't see how this can work for $N<8; in fact, it doesn't:
match_0s(1,"\201\201\201\201") => -1
  • Comment on Re^3: Locating a specified number of contiguous 0 bits within a large bitstring efficiently.
  • Download Code

Replies are listed 'Best First'.
Re^4: Locating a specified number of contiguous 0 bits within a large bitstring efficiently.
by Grimy (Pilgrim) on Jun 07, 2013 at 12:47 UTC

    Oops, thanks for catching that.

    I edited my previous post.

Re^4: Locating a specified number of contiguous 0 bits within a large bitstring efficiently.
by BrowserUk (Patriarch) on Jun 07, 2013 at 14:21 UTC

    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.