* include/ruby/ruby.h (POSFIXABLE): use FIXNUM_MAX+1 instead of

FIXNUM_MAX to make it possible to convert to double accurately.
  It assumes FLT_RADIX is 2.
  fix RubyForge bug #14102.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-04-28 05:25:03 +00:00
parent 6837681a4c
commit 6daf556345
3 changed files with 42 additions and 1 deletions

View file

@ -193,7 +193,7 @@ VALUE rb_ull2inum(unsigned LONG_LONG);
#define FIX2LONG(x) RSHIFT((SIGNED_VALUE)x,1)
#define FIX2ULONG(x) ((((VALUE)(x))>>1)&LONG_MAX)
#define FIXNUM_P(f) (((SIGNED_VALUE)(f))&FIXNUM_FLAG)
#define POSFIXABLE(f) ((f) <= FIXNUM_MAX)
#define POSFIXABLE(f) ((f) < FIXNUM_MAX+1)
#define NEGFIXABLE(f) ((f) >= FIXNUM_MIN)
#define FIXABLE(f) (POSFIXABLE(f) && NEGFIXABLE(f))