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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Creating several types from a base type and conversion Date: Sat, 18 Jan 2020 17:13:14 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <4b0649b3-aed2-44fd-822f-d6665b9352dd@googlegroups.com> <0001HW.23D35416021671CF70000511B2EF@news.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 18 Jan 2020 16:13:16 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="9b70512078c977b5438be1f9a698e867"; logging-data="20793"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18I26wVEXcyYUoDYr7JLMr4FJLDRFXzP5c=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 Cancel-Lock: sha1:KTg2QPbnpSd2+HdDOjBI8bkBNbU= In-Reply-To: <0001HW.23D35416021671CF70000511B2EF@news.individual.net> Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:57875 Date: 2020-01-18T17:13:14+01:00 List-Id: On 1/18/20 3:56 PM, Bill Findlay wrote: > > Use the type: > > mod 2**30 > > which provides all the bit handling you need. Except for shifts and rotations, which most instruction sets provide. Shifts can be replaced by multiplication and division by powers of two. Rotations are a little more complex. -- Jeff Carter "He didn't get that nose from playing ping-pong." Never Give a Sucker an Even Break 110