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: Robert Dewar Subject: Re: Type casting question Date: 1999/12/21 Message-ID: <83o9d0$ul9$1@nnrp1.deja.com>#1/1 X-Deja-AN: 563341881 References: <385E87D8.2B44B800@tridsys.com> X-Http-Proxy: 1.0 x35.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Tue Dec 21 16:20:53 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-12-21T00:00:00+00:00 List-Id: In article <385E87D8.2B44B800@tridsys.com>, comp.lang.ada@ada.eu.org wrote: > Question: Could someone please provide some solution > to the below? > > I have this question in the conversion of values > between the string and the my own type shown below. > > 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; The size clause is unnecessary in either case, since the default size in both cases is obviously 5! Sent via Deja.com http://www.deja.com/ Before you buy.