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!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: FNV-1 Date: Thu, 31 Oct 2013 15:00:41 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: <87a31163-91a2-471a-9b98-8f5b1414037e@googlegroups.com> <579437d2-b330-46b2-90cd-0c3b8fcd43ac@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 31 Oct 2013 22:00:43 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="b91ebeedbc496c8222e2854f15ee7105"; logging-data="17303"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX192/pfi0W5dHwVu9nt1ntHbicmgrrMSmuY=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: Cancel-Lock: sha1:roS2fwE00iED0ZhKTFcGB7vISPQ= Xref: news.eternal-september.org comp.lang.ada:17568 Date: 2013-10-31T15:00:41-07:00 List-Id: On 10/31/2013 01:35 PM, Adam Beneschan wrote: > On Thursday, October 31, 2013 12:46:06 PM UTC-7, sbelm...@gmail.com wrote: >> >> I was considering this, but convinced myself that since everything is still >> a modulus type, the extra bit would be required for the entire range (i.e. >> if you need 32 bits to hold 0..2**32-1, then you still need all 32 bits for >> 1..2**32-1). I played around with a few different sizes, and GNAT seemed >> to give errors (and warnings) where needed, so I sort of let it lie. As >> long non-powers of two end up with errors and warnings, I guess that's the >> important part. > > You're right, I missed that the base type is a modular type. (I've had lots > of problems with 'Size of subtypes of signed integer types, which is why the > code raised red flags with me ... but I forgot to check that. Sorry.) I don't really see the point of these subtypes. They're not referenced once the appropriate constant objects are defined. Possibly to cause an exception if the "when others" branch is taken in one of the case expressions, but I'd think an assertion would be clearer. -- Jeff Carter "[I]f we should ever separate, my little plum, I want to give you one little bit of fatherly advice. ... Never give a sucker an even break." Poppy 97