On the Ruby tutorials I'm watching when you enter a number with .class
it returns either Bignum
or Fixnum
.
When I do this I get Integer
instead:
12345.class
#=> Integer
I'm using irb in the command line on a mac. Why does the above not return Fixnum
like it does in the tutorials?
It depends on the Ruby version. From Ruby 2.4.0 we have just Integer
s, no more Fixnum
s and Bignum
s distinction
https://www.ruby-lang.org/en/news/2016/12/25/ruby-2-4-0-released/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With