unsigned int in float assignment

Richard Henderson rth@redhat.com
Wed Apr 3 00:33:00 GMT 2002


On Wed, Apr 03, 2002 at 12:23:04AM -0800, Richard Henderson wrote:
> On Wed, Apr 03, 2002 at 09:19:10AM +0100, Trent Waddington wrote:
> > printf("%i\n", 0U - 53);
> 
> What's your point?  You've printed an unsigned quantity
> as a signed value.

Do

  cout << (0U - 53) << endl;

instead.  C++ overloading will show you how the
promotions work.


r~



More information about the Gcc-bugs mailing list