Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

12345.class returning 'Integer' not 'Fixnum' in Ruby

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?

like image 948
pjk_ok Avatar asked Mar 08 '23 16:03

pjk_ok


1 Answers

It depends on the Ruby version. From Ruby 2.4.0 we have just Integers, no more Fixnums and Bignums distinction

https://www.ruby-lang.org/en/news/2016/12/25/ruby-2-4-0-released/

like image 104
Ursus Avatar answered Mar 10 '23 23:03

Ursus