bit_utils 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +10 -0
- data/README.md +2 -1
- data/lib/bit_utils.rb +6 -0
- data/lib/bit_utils/core_ext/each_bit.rb +19 -15
- data/lib/bit_utils/core_ext/popcount.rb +20 -15
- data/lib/bit_utils/core_ext/trailing_zeros.rb +19 -15
- data/lib/bit_utils/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29652b1461a6f57881077b9d2ce9b84bfee96963
|
4
|
+
data.tar.gz: 88af702fdf33ecfdc358cff4df09ae0c58a58a66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4f21aa80e65fb35bedd46e7229489d8d814515e7f4716f1d6882c837ab09690badc5ab9045056b7ecd921c9873adfe5f4b69f0c69a6428a6dbc5b0744a45a3c
|
7
|
+
data.tar.gz: bfea8c370f5088ccf1745855ce0e439e30a60c553721c0610a31aa6b1ff9ca1b342508d5789bfbb34237238061f2cfd671c636b2dba5cc45ceb84b8adb76ed42
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -53,7 +53,8 @@ If negative `num` is given, it raises `RangeError`
|
|
53
53
|
### common to all functionalities
|
54
54
|
All of the module functions raise `TypeError` unless the parameter is `Integer`.
|
55
55
|
|
56
|
-
All module functions have `.#xxx_fixnum` and `.#xxx_bignum` (specific for `Fixnum` and `Bignum`), but these are not intended for direct use
|
56
|
+
All module functions have `.#xxx_fixnum` and `.#xxx_bignum` (specific for `Fixnum` and `Bignum`), but these are not intended for direct use;
|
57
|
+
these will be removed in the future..
|
57
58
|
|
58
59
|
|
59
60
|
## Development
|
data/lib/bit_utils.rb
CHANGED
@@ -1,15 +1,19 @@
|
|
1
|
-
require 'bit_utils'
|
2
|
-
|
3
|
-
# Core Extension for
|
4
|
-
class
|
5
|
-
def each_bit(&block)
|
6
|
-
BitUtils.
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
require 'bit_utils'
|
2
|
+
|
3
|
+
# Core Extension for Integer
|
4
|
+
class Integer
|
5
|
+
def each_bit(&block)
|
6
|
+
BitUtils.each_bit self, &block
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
unless BitUtils::INTEGER_UNITED
|
11
|
+
|
12
|
+
# Core Extension for Fixnum
|
13
|
+
class Fixnum
|
14
|
+
def each_bit(&block)
|
15
|
+
BitUtils.each_bit_fixnum self, &block
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -1,15 +1,20 @@
|
|
1
|
-
require 'bit_utils'
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
require 'bit_utils'
|
2
|
+
|
3
|
+
|
4
|
+
# Core Extension for Integer
|
5
|
+
class Integer
|
6
|
+
def popcount
|
7
|
+
BitUtils.popcount self
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
unless BitUtils::INTEGER_UNITED
|
12
|
+
|
13
|
+
# Core Extension for Fixnum
|
14
|
+
class Fixnum
|
15
|
+
def popcount
|
16
|
+
BitUtils.popcount_fixnum self
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -1,15 +1,19 @@
|
|
1
|
-
require 'bit_utils'
|
2
|
-
|
3
|
-
# Core Extension for
|
4
|
-
class
|
5
|
-
def trailing_zeros
|
6
|
-
BitUtils.
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
require 'bit_utils'
|
2
|
+
|
3
|
+
# Core Extension for Integer
|
4
|
+
class Integer
|
5
|
+
def trailing_zeros
|
6
|
+
BitUtils.trailing_zeros self
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
unless BitUtils::INTEGER_UNITED
|
11
|
+
|
12
|
+
# Core Extension for Fixnum
|
13
|
+
class Fixnum
|
14
|
+
def trailing_zeros
|
15
|
+
BitUtils.trailing_zeros_fixnum self
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/lib/bit_utils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bit_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jkr2255
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: function_module
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- ".gitignore"
|
106
106
|
- ".rspec"
|
107
107
|
- ".travis.yml"
|
108
|
+
- CHANGELOG.md
|
108
109
|
- Gemfile
|
109
110
|
- LICENSE.txt
|
110
111
|
- README.md
|