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,f9957894e0bdf128 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 13 Jan 2009 19:23:56 -0600 From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: How to put 200 into an integer sub-type of 16 bits (code included) Date: Wed, 14 Jan 2009 01:33:28 +0000 Reply-To: brian@shapes.demon.co.uk Message-ID: <71gqm49eatq868htrvd7eghm3m8su8kcbl@4ax.com> References: <407ae64d-3cb3-4310-b59e-f1bbae9910a5@t39g2000prh.googlegroups.com> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-Yrfzz6t2DnXL83vt1hkD0LGTBSxKSkx9H/cAM67VR0pcLqfzeXrsQxz/kkBQzZN+vnePMso7eYbbev3!C1Qv8zonRpX3Ek0Na27A1Nqq94vVse63KwfB+/6578kGHrNiLzwS5S7GxYUvNTlG8q1JRqORjN2v!wnN1 X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Xref: g2news2.google.com comp.lang.ada:4245 Date: 2009-01-14T01:33:28+00:00 List-Id: On Tue, 13 Jan 2009 12:26:22 -0800 (PST), ChristopherL wrote: >(1)The below code compiles but I get a run time exception. > >If I do not modify the definitions of Arg or Result how can I >make Arg's value fit into Result's 16 bits. > >Result is a subrange of integer going from -128 to 127 which is >16 bits. Actually that's 8 bits... what are you really trying to do? If you need to put 200 in an 8-bit type, why not use Natural range 0 to 255? - Brian