From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,eda443e5aaf028c4 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Suprise of comparison result Date: 1999/10/18 Message-ID: <7ue030$nqk$1@nnrp1.deja.com>#1/1 X-Deja-AN: 537271454 References: <37fd7e17.0@news.pacifier.com> <37FDB8D1.CC4CDB7B@gecm.com> <37fece61.0@news.pacifier.com> X-Http-Proxy: 1.0 x23.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Mon Oct 18 02:19:20 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-10-18T00:00:00+00:00 List-Id: In article <37fece61.0@news.pacifier.com>, "Steve Doiel" wrote: > The behavior I had hoped for was a compile time error when I attempted to > compare an integer value (-32768) to a modular value. I understand that > things just don't work that way, but it was a bit of a dissapointment. But what possible basis would there be for an error here. It is very useful to have unary minus work on modular numbers, and it would indeed be a nasty irregularity if -x was not the same as 0-x for modular types. If you properly understand twos complement arithmetic, the use of unary minus is often convenient, for example doing x := -1; to set x to all 1 bits is often convenient ... Sent via Deja.com http://www.deja.com/ Before you buy.