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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f9957894e0bdf128 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!r15g2000prd.googlegroups.com!not-for-mail From: sjw 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 13:09:50 -0800 (PST) Organization: http://groups.google.com Message-ID: <7b017de2-951a-414a-8290-111353fe02f8@r15g2000prd.googlegroups.com> References: <407ae64d-3cb3-4310-b59e-f1bbae9910a5@t39g2000prh.googlegroups.com> <71gqm49eatq868htrvd7eghm3m8su8kcbl@4ax.com> NNTP-Posting-Host: 62.49.19.209 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1231967391 1217 127.0.0.1 (14 Jan 2009 21:09:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 14 Jan 2009 21:09:51 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r15g2000prd.googlegroups.com; posting-host=62.49.19.209; posting-account=_RXWmAoAAADQS3ojtLFDmTNJCT0N2R4U User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:3294 Date: 2009-01-14T13:09:50-08:00 List-Id: On Jan 14, 1:33=A0am, Brian Drummond wrote: > If you need to put 200 in an 8-bit type, why not use > Natural range 0 to 255? Natural range has the same number of bits as Integer, which has to be at least 16 and is very likely to be 32 (or maybe 64 on a 64- bit machine). type Short is mod 256; for Short'Size use 8; -- a confirming representation clause For those of a C background, Short is a bad name here. Byte? Interfaces.Unsigned_8? --S