This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: unsigned int in float assignment



printf("%i\n", 0U - 53);

On Tue, 2 Apr 2002, Richard Henderson wrote:

> On Tue, Apr 02, 2002 at 08:51:15PM +0100, Trent Waddington wrote:
> >       u = r - 53;
> 
> Because "0U - 53" is computed as an unsigned operation, which by
> definition uses modular arithmetic.  Thus the result will be very
> large positive number rather than a small negative number.
> 
> 
> r~
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]