From: eregontp@... Date: 2018-01-20T14:22:13+00:00 Subject: [ruby-core:84947] [Ruby trunk Bug#14378] On windows, RUBY_FIXNUM_MAX of 64 bits ruby is 32 bits Issue #14378 has been updated by Eregon (Benoit Daloze). This is indeed very surprising that on a platform with 64-bit pointers, Fixnum are still only 30 bits. +1 to making this more intuitive. It creates a lot of weird edge cases in ruby/spec. There are also places in the code where VALUE is used as a synonym of unsigned long (e.g.: rb_uint2inum(VALUE)) but those should just be replaced by "unsigned long". ---------------------------------------- Bug #14378: On windows, RUBY_FIXNUM_MAX of 64 bits ruby is 32 bits https://bugs.ruby-lang.org/issues/14378#change-69657 * Author: HfCloud (Xiangyu Shi) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: 2.5.0 * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- On windows, start an IRB of a 64-bits ruby, enter these code: ~~~ruby (1<<29).equal?(1<<29) #=>true (1<<30).equal?(1<<30) #=>false ~~~ So, it is that FIXNUM of the 64-bits ruby is a 32-bits data? But my friend try these code on linux platform and all got true(it means FIXNUM is 64bits) Then I opened ruby/ruby.h and found this: ~~~ ruby #define RUBY_FIXNUM_MAX (LONG_MAX>>1) ~~~ The LONG_MAX of my compiler(msvc140, vs2017) is 2147483647, and the ruby which is installed by ruby-installer also have the same problem. -- https://bugs.ruby-lang.org/ Unsubscribe: