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: 103376,1cd9f7e5a0d12003 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.241.7 with SMTP id we7mr466455pbc.4.1337710782139; Tue, 22 May 2012 11:19:42 -0700 (PDT) Path: pr3ni28781pbb.0!nntp.google.com!news1.google.com!feed-C.news.volia.net!volia.net!news2.volia.net!feed-A.news.volia.net!newsfeed.utanet.at!newsfeed.tele2net.at!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 20:18:08 +0200 Organization: cbb software GmbH Message-ID: <169ese9h2bjqo.1qh6482rfr02t.dlg@40tude.net> References: <15puwddz4h6cl$.34i9lxveafeb.dlg@40tude.net> <3b5cewxtwayd.x41gqd4lwwm9.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 4RFYTQ6jM/dAKFJoI0fUkg.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-22T20:18:08+02:00 List-Id: On Tue, 22 May 2012 18:26:58 +0100, BartC wrote: > "Dmitry A. Kazakov" wrote in message > news:3b5cewxtwayd.x41gqd4lwwm9.dlg@40tude.net... >> On Tue, 22 May 2012 17:25:17 +0100, BartC wrote: >>> "Dmitry A. Kazakov" wrote in message > >>>> The answer is to have + and - >>>> closed. What about *? That would make it x2 bits wider. What about >>>> exponentiation? Much more bits. Factorial? >>> >>> We're talking about C where operations and their results usually have the >>> same predefined width. >> >> Irrelevant. The concept either works or does not. In this case it does >> not. > > That's fine. But in that case, every calculator or computer ever made is > useless, because you can always think up some calculation just beyond it's > capacity. But calculators do not work with non-modular unsigned integers. The idea of having a constrained subtype of a constrained or not integer type is all OK. This is how such types are defined in Ada: subtype Natural is new Integer range 0..Integer'Last; Wrong is an attempt to define a new type pretending it were unconstrained because some extra bits. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de