Code Monkey home page Code Monkey logo

bitset's People

Contributors

tdegrunt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bitset's Issues

No license

Hi! I'd love to be able to use this tool in one of my projects but no license is attached. If you'd consider adding one, I'd appreciate that greatly. Thank you!

Length of the bitset

Hello,

How "long" so to speak can the bitset be? I am considering a leap into JavaScript, React, Node, etc, and along with that, will need some sort of extensible bitset. Should be able to support arbitrary length bitsets, complete with bitwise operations, serialization to/from string, bit as well as hex or even base-n representation. Serialization might be pushing it, but it does need to be extensible. Wondering if this is that?

Thank you...

andNot not working as expected

Hey,
Thanks for sharing this code, really helpful! Just a quick observation about the andNot method.
This function fails to pass the following test:

        bitSet = new BitSet();
        BitSet bs = bitSet;
        for (int i = 0; i <= 7; i++) {
             bitSet.set(i);
        }
        bs.clear(5);
        BitSet bs2 = new BitSet();
        bs2.set(2);
        bs2.set(3);
        bs.andNot(bs2);
        assertEquals("Incorrect bitset after andNot",
                "{0, 1, 4, 6, 7}", bs.toString());
        bs = new BitSet(0);
        bs.andNot(bs2);
        assertEquals("Incorrect size", 0, bs.length());

Fails assertion with "incorrect bitset after andNot", I see "{0,1,2,3,4,6,7}" instead of "{0, 1, 4, 6, 7}"
I have moved to using this implementation as well : https://github.com/atonparker/bitterset

Please publish a new version

The version that gets installed when typing npm install bitset (0.3.0) is broken. I had to type npm install tdegrunt/bitset to get a working distribution.

Should be a matter of git tag 0.4.0 and npm publish...

Clear bit will not work correctly

clear: (pos) ->
       @store[@wordIndex(pos)] &= (0xFF ^ (1 << pos))

code should be

clear: (pos) ->
      @store[@wordIndex(pos)] &= (-1 ^ (1 << pos))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.