Skip to content

jmaister/bitarray

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

bitarray

Full Python implementation of a bitarray.

Memory optimization: It packs 32 or 64 bits on a float. Depending on the platform.

Blog entry with explanation on: jordiburgos.com/post/2014/python-bitarray-sieve-eratosthenes.html

Usage:

MAX = 2^^32

ba = BitArray(MAX, initialize=1)
for n in xrange(2, MAX, 2):
    ba.reset_bit(n)

ba.set_bit(120)

if ba.get_bit(120):
    pass

Sample usage on pysieve.py

About

Python implementation of a bitarray

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages