unsigned int in float assignment

Trent Waddington trent@codeplay.com
Wed Apr 3 00:20:00 GMT 2002


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~
> 



More information about the Gcc-bugs mailing list