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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 1014db,edd83659ff9286d0 X-Google-NewGroupId: yes X-Google-Thread: 103376,1cd9f7e5a0d12003 X-Google-NewGroupId: yes X-Google-Thread: 1094ba,1cd9f7e5a0d12003 X-Google-NewGroupId: yes X-Google-Attributes: gid4516fb5702,gida07f3367d7,gid8d3408f8c3,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.195.165 with SMTP id if5mr26737132pbc.1.1337688519253; Tue, 22 May 2012 05:08:39 -0700 (PDT) Path: pr3ni26988pbb.0!nntp.google.com!news1.google.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.c,comp.lang.ada,comp.lang.fortran Subject: Re: condition true or false? -> (-1 < sizeof("test")) Date: Tue, 22 May 2012 14:07:05 +0200 Organization: cbb software GmbH Message-ID: <15puwddz4h6cl$.34i9lxveafeb.dlg@40tude.net> References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-05-22T14:07:05+02:00 List-Id: On Tue, 22 May 2012 10:55:01 +0100, BartC wrote: > With the new-unsigned type behaving as I have suggested a few times [in the > original thread in comp.lang.c], just a subrange of a signed type (for > example, a hypothetical signed integer type that is one bit wider). > > With the new-unsigned type, a negation operation must have signed result > (because, other than -0, it will be negative). While subtraction would need > to be signed too, as results can be negative. And of course there is the > likelihood of overflow or underflow, for which I will leave to other > language proposals to deal with.. Integer arithmetic is more than just + and -. Did you ask yourself what is the motivation to have it one bit wider? The answer is to have + and - closed. What about *? That would make it x2 bits wider. What about exponentiation? Much more bits. Factorial? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de