|The signs of literals email@example.com (Hung-Ta Lin) (1997-12-07)|
|Re: The signs of literals firstname.lastname@example.org (David L Moore) (1997-12-10)|
|Re: The signs of literals email@example.com (Chris Clark USG) (1997-12-10)|
|Re: The signs of literals firstname.lastname@example.org (1997-12-12)|
|Re: The signs of literals tim@wagner.Princeton.EDU (1997-12-12)|
|Re: The signs of literals email@example.com (Matt Timmermans) (1997-12-12)|
|Re: The signs of literals firstname.lastname@example.org (David L Moore) (1997-12-13)|
|From:||email@example.com (Henry Baker)|
|Date:||12 Dec 1997 14:45:04 -0500|
David L Moore <firstname.lastname@example.org> wrote:
> Second, it would be incorrect to treat a negative number as a positive
> number with a unary minus preceding it because, if your machine is
> two's compliment, you can now not represent the largest negative
> integer (eg -32768 in 16 bit) as a constant.
The solution to this problem is well-known and trivial. You _always_
build up integers using _negative_ arithmetic, as in `n:=10*n-d'.
You then convert to positive at the last moment _unless_ you see a
There was an article about this issue in Sigplan Notices around 1980
Return to the
Search the comp.compilers archives again.