Hacker News new | ask | show | jobs
by bschaefer 5869 days ago
This is a performance optimization for common (read: integer) numbers: http://ruby-doc.org/core/classes/Fixnum.html

  >> ((1 << 30) - 1).class
  => Fixnum
  >> ((1 << 30)).class
  => Bignum

  >> ((1 << 30) - 1).object_id
  => 2147483647
  >> ((1 << 30) - 1).object_id
  => 2147483647

  >> (1<<30).object_id
  => 166070
  >> (1<<30).object_id
  => 161200