Re: [Cleanup] Int vs Long #3

From: Michal Rokos <m.rokos@...>
Date: 2002-08-23 09:12:57 UTC
List: ruby-core #348
Hello,

	thank you for a kind review again.
	
On Fri, Aug 23, 2002 at 08:47:10AM +0900, nobu.nokada@softhome.net wrote:
> > --- numeric.c	2002/08/21 15:47:54	1.56
> > +++ numeric.c	2002/08/22 16:07:44
> > @@ -1022,7 +1022,7 @@
> >  {
> >      if (FIXNUM_P(num)) {
> >  	long i = FIX2LONG(num) + 1;
> > -	return rb_int2inum(i);
> > +	return LONG2FIX(i);
> >      }
> >      return rb_funcall(num, '+', 1, INT2FIX(1));
> >  }
> 
> This arithmetic operation may overflow.  You might intended
> LONG2NUM() here too?

	Thanks. Changed.
	
> 
> # I'd like you to use -p option.
>
	Sorry, I don't know what do you mean by this.

		Michal

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michal Rokos                         Czech Technical University, Prague
E-mail:m.rokos@sh.cvut.cz      ICQ:36118339      Jabber:majkl@jabber.cz
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

In This Thread