https://github.com/halfdan/ruby-bitfield
This Ruby C extension wraps boost::dynamic_bitset and makes it available as a native Ruby class. The bitset behaves like an an array allowing only values of 0 and 1
https://github.com/halfdan/ruby-bitfield
Last synced: 12 months ago
JSON representation
This Ruby C extension wraps boost::dynamic_bitset and makes it available as a native Ruby class. The bitset behaves like an an array allowing only values of 0 and 1
- Host: GitHub
- URL: https://github.com/halfdan/ruby-bitfield
- Owner: halfdan
- License: bsd-2-clause
- Created: 2011-10-25T20:20:30.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2020-09-29T14:33:37.000Z (over 5 years ago)
- Last Synced: 2024-04-25T15:41:33.649Z (almost 2 years ago)
- Language: C++
- Homepage:
- Size: 11.7 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.rdoc
- License: LICENSE
Awesome Lists containing this project
README
= BitField
This C extension wraps boost::dynamic_bitset and makes it available
as a native Ruby class. The bitset behaves like an array allowing
only values of 0 and 1. Using this extension is easy:
b = BitField.new 10 # Initializes BitField with size 10
puts b # Prints '0000000000' where the last bit is b[0]
b[0..3] = Array.new(4) {1} # Sets bits 0 to 3 to 1
Note that in contrast to the Ruby Array behaviour the BitField does not
automatically grow in size.
= Licence
Copyright(c) 2011 Fabian Becker, released under 2-clause BSD licence.