comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: condition true or false? ->  (-1 < sizeof("test"))
Date: Tue, 22 May 2012 20:18:08 +0200
Date: 2012-05-22T20:18:08+02:00	[thread overview]
Message-ID: <169ese9h2bjqo.1qh6482rfr02t.dlg@40tude.net> (raw)
In-Reply-To: jpgi9m$ebr$1@dont-email.me

On Tue, 22 May 2012 18:26:58 +0100, BartC wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
> news:3b5cewxtwayd.x41gqd4lwwm9.dlg@40tude.net...
>> On Tue, 22 May 2012 17:25:17 +0100, BartC wrote:
>>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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



  reply	other threads:[~2012-05-22 18:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <95634f38f6ee0d116da523fdc2c9f5ca@dizum.com>
2012-05-21 15:28 ` condition true or false? -> (-1 < sizeof("test")) Nomen Nescio
2012-05-21 15:37   ` Richard Maine
2012-05-21 15:45   ` Adam Beneschan
2012-05-21 17:16     ` Robert A Duff
2012-05-22  1:08   ` Terence
2012-05-22  7:54     ` Les Neilson
2012-05-22 23:19       ` Terence
2012-05-23  7:20         ` Les Neilson
2012-05-22 15:43     ` Fritz Wuehler
2012-05-22  1:45   ` glen herrmannsfeldt
2012-05-22  6:11     ` Nomen Nescio
2012-05-22  8:00       ` Martin
2012-05-22  9:55       ` BartC
2012-05-22 12:07         ` Dmitry A. Kazakov
2012-05-22 16:25           ` BartC
2012-05-22 17:03             ` Dmitry A. Kazakov
2012-05-22 17:26               ` BartC
2012-05-22 18:18                 ` Dmitry A. Kazakov [this message]
2012-05-23  7:26                   ` Terence
2012-05-22 17:56         ` Fritz Wuehler
2012-05-22 10:29     ` Georg Bauhaus
2012-05-30  3:22   ` robin.vowels
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox