This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: unsigned int in float assignment
- From: Trent Waddington <trent at codeplay dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 3 Apr 2002 09:19:10 +0100 (GMT Daylight Time)
- Subject: 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~
>