[Mono-list] bug found! :-)

Rohit rohits79@yahoo.com
Tue, 26 Aug 2003 03:05:53 -0700 (PDT)


please see inline...

--- "Thong (Tum) Nguyen" <tum@veridicus.com> wrote:
> Hmm..that's not the reason.
> 
> 4/3 isn't an integer if you're doing floating point
> arithmetic but
> that's not what's happening here. Notice how the
> following compiles
> without an error:
> 
> int u = 3;
> int I = 4;
> int o = i / u;
> 
> The reason there is an error in Maurizio's code is
> because dividing an
> integer by an unsigned integer yields a long
> (otherwise precision would
> be lost).  The resulting long can't be assigned to
> the integer "o"
> without a cast.  

that is exactly what I mean when I said 4/3 != integer
(i did mean 3 is of uint type as was asked and as
gaurav too correctly and clearly pointed out).

> 
> Of course the error should be "cannot convert from
> long to int" rather
> than "cannot convert from int to long".
> 
> All the best,
> 
> ^Tum
> 
> > -----Original Message-----
> > From: mono-list-admin@lists.ximian.com
> [mailto:mono-list-
> > admin@lists.ximian.com] On Behalf Of Rohit
> > Sent: Tuesday, 26 August 2003 3:37 p.m.
> > To: Maurizio Colucci; mono-list@lists.ximian.com
> > Subject: Re: [Mono-list] bug found! :-)
> > 
> > thats not a bug!
> > cause
> > 
> > 4/3 = 1.3333333333333333333333333333333 !=
> integer.
> > 
> > thanks
> > rohit
> > --- Maurizio Colucci <seguso.forever@tin.it>
> wrote:
> > > uint u = 3;
> > > int i = 4;
> > > int o = i/u; << error
> > >
> > > Mono gives the error: cannot convert from int to
> > > long.
> > > But there is no long here, just an uint (32
> bits).
> > >
> > >
> > > mono 0.26 redhat rpms.
> > >
> > > _______________________________________________
> > > Mono-list maillist  - 
> Mono-list@lists.ximian.com
> > >
> http://lists.ximian.com/mailman/listinfo/mono-list
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site
> design software
> > http://sitebuilder.yahoo.com
> > _______________________________________________
> > Mono-list maillist  -  Mono-list@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list
> > 
> > 
> > ---
> > Incoming mail is certified Virus Free.
> > Checked by AVG anti-virus system
> (http://www.grisoft.com).
> > Version: 6.0.298 / Virus Database: 161 - Release
> Date: 13/11/2001
> > 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system
> (http://www.grisoft.com).
> Version: 6.0.298 / Virus Database: 161 - Release
> Date: 13/11/2001
>  
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com