comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: FNV-1
Date: Thu, 31 Oct 2013 15:00:41 -0700
Date: 2013-10-31T15:00:41-07:00	[thread overview]
Message-ID: <l4uju9$gsn$1@dont-email.me> (raw)
In-Reply-To: <ac65c8dd-8e22-41dd-9cd2-cd99b6af9782@googlegroups.com>

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

  reply	other threads:[~2013-10-31 22:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30 23:31 FNV-1 sbelmont700
2013-10-31  0:03 ` FNV-1 Adam Beneschan
2013-10-31  0:03   ` FNV-1 Adam Beneschan
2013-10-31 19:46   ` FNV-1 sbelmont700
2013-10-31 20:35     ` FNV-1 Adam Beneschan
2013-10-31 22:00       ` Jeffrey Carter [this message]
2013-11-01 13:40 ` FNV-1 Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox