Created
December 22, 2013 12:07
-
-
Save jacobat/8081667 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin13.0] | |
>> machine_bytes = ['foo'].pack('p').size | |
=> 8 | |
>> machine_bits = machine_bytes * 8 | |
=> 64 | |
>> machine_max_signed = 2**(machine_bits-1) - 1 | |
=> -9223372036854775809 | |
>> machine_max_unsigned = 2**machine_bits - 1 | |
=> -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby 1.8.7 (2012-02-08 patchlevel 358) [i686-darwin13.0.2] | |
irb(main):070:0> machine_bytes = ['foo'].pack('p').size | |
=> 8 | |
irb(main):071:0> machine_bits = machine_bytes * 8 | |
=> 64 | |
irb(main):072:0> machine_max_signed = 2**(machine_bits-1) - 1 | |
=> 9223372036854775807 | |
irb(main):073:0> machine_max_unsigned = 2**machine_bits - 1 | |
=> 18446744073709551615 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment