diff options
-rw-r--r-- | lib/zipf/misc.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/zipf/misc.rb b/lib/zipf/misc.rb index 4d29a06..02291c7 100644 --- a/lib/zipf/misc.rb +++ b/lib/zipf/misc.rb @@ -111,3 +111,11 @@ def read_config fn return cfg end +# https://gist.github.com/pithyless/9738125 +class Integer + N_BYTES = [42].pack('i').size + N_BITS = N_BYTES * 16 + MAX = 2 ** (N_BITS - 2) - 1 + MIN = -MAX - 1 +end + |