Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: checking for overflow in C
Message-ID: <1989May18.170422.1513@utzoo.uucp>
Organization: U of Toronto Zoology
References: <13367@dartvax.Dartmouth.EDU> <1989May6.224226.22085@utzoo.uucp> <472@chem.ucsd.EDU> <11538@ulysses.homer.nj.att.com>
Date: Thu, 18 May 89 17:04:22 GMT

In article <11538@ulysses.homer.nj.att.com> ggs@ulysses.homer.nj.att.com (Griff Smith) writes:
>... After doing an `add' that causes overflow, it's
>a bit late to tell the hardware that you were doing an unsigned add.
>Preventing the overflow is often an expensive operation.

Then C's unsigned arithmetic will be expensive on that machine.  Unsigned
arithmetic in C is *required* to be non-overflowing.
-- 
Subversion, n:  a superset     |     Henry Spencer at U of Toronto Zoology
of a subset.    --J.J. Horning | uunet!attcan!utzoo!henry henry@zoo.toronto.edu
