-
-
Save 2called-chaos/998020a21ab2da4fb787 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
Fixnum | |
Holds Integer values that can be represented in a native machine word (minus 1 bit). | |
If any operation on a Fixnum exceeds this range, the value is automatically converted to a Bignum. |
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
[1] pry(main)> 10.class | |
=> Fixnum | |
[2] pry(main)> 10.is_a?(Integer) | |
=> true | |
[3] pry(main)> 10.is_a?(Fixnum) | |
=> true | |
[4] pry(main)> 10.is_a?(Bignum) | |
=> false | |
[5] pry(main)> 999999999999999999999999999999.class | |
=> Bignum | |
[6] pry(main)> 999999999999999999999999999999.is_a?(Integer) | |
=> true | |
[7] pry(main)> 999999999999999999999999999999.is_a?(Fixnum) | |
=> false | |
[8] pry(main)> 999999999999999999999999999999.is_a?(Bignum) | |
=> true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment