Skip to content

Instantly share code, notes, and snippets.

@trans
Created June 24, 2009 09:34
Show Gist options
  • Save trans/135123 to your computer and use it in GitHub Desktop.
Save trans/135123 to your computer and use it in GitHub Desktop.
Fixnum Constants
# Fixnum Constants
# Constants providing the numerical limitations of Fixnum class.
#
class Fixnum
N_BYTES = [42].pack('i').size
N_BITS = N_BYTES * 8
MAX = 2 ** (N_BITS - 2) - 1
MIN = -MAX - 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment