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,7c79b932e1a23ed9 X-Google-Attributes: gid103376,public From: reason67@my-deja.com Subject: Re: Type casting question Date: 1999/12/21 Message-ID: <83of3h$352$1@nnrp1.deja.com>#1/1 X-Deja-AN: 563369674 References: <385E87D8.2B44B800@tridsys.com> <83o9d0$ul9$1@nnrp1.deja.com> X-Http-Proxy: NetCache@www-blv-proxy1.boeing.com: Version NetApp Release 3.4D6: Mon Aug 23 16:40:19 PDT 1999-Solaris, 1.0 x21.deja.com:80 (Squid/1.1.22) for client 12.13.226.11 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Tue Dec 21 17:58:12 1999 GMT X-MyDeja-Info: XMYDJUIDreason67 Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.05 [en]C-Boeing Kit (Win95; I) Date: 1999-12-21T00:00:00+00:00 List-Id: In article <83o9d0$ul9$1@nnrp1.deja.com>, Robert Dewar wrote: > In article <385E87D8.2B44B800@tridsys.com>, > > type Bit_5 is range 2#0# .. 2#11111#; > > for Bit_5'Size use 5; > > subtype Size_Type is Bit_5; > > By the way, it is almost certainly wrong to have the base > type of Bit_5 be signed. > > Almost certainly what you want here is > > type Bit_5 is mod 2 ** 5; Assuming he is using Ada95 and not Ada 83. > The size clause is unnecessary in either case, since the > default size in both cases is obviously 5! I have used compilers that, unless you specified, put all integer types to a size of 32 by default. I do not know if the Ada95 LRM specifies that the type must be sized to the minimum or not. --- Jeffrey S. Blatt Sent via Deja.com http://www.deja.com/ Before you buy.