Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
Posted: Tue Oct 31, 2006 9:55 am
Ints default to unsigned, so b-c=253, abs(253)=253, so a=253 just as it ought to.
Perhapse you should declare your variables as "signed int". _________________ The search for better is endless. Instead simply find very good and get the job done.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum