From: Martin Jambon <martin.jambon@ens-lyon.org>
To: Thomas Braibant <thomas.braibant@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Re: Hashing failure
Date: Thu, 20 Dec 2012 13:01:45 -0800 [thread overview]
Message-ID: <50D37CB9.7020105@ens-lyon.org> (raw)
In-Reply-To: <CAHR=Vkw1RWKmRC12k_O06-CYM7+DNLc2jQ424KdyPqwGDDHc6A@mail.gmail.com>
On Thu 20 Dec 2012 12:32:07 PM PST, Thomas Braibant wrote:
> The second piece of code should read
>> let hkey = H.hash d in
>> let index = (abs hkey) mod (Array.length t.table) in
>> let bucket = t.table.(index) in (* 1 *)
>
> Sorry for the noise.
You can use (if hkey = min_int then 0 else abs hkey). It is guaranteed
to work and won't cost much.
Martin
next prev parent reply other threads:[~2012-12-20 21:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAHR=VkzBhR5FMsWO-_BVzYV4yhSARP8rg7G3b=jezU6OOOg0jQ@mail.gmail.com>
2012-12-20 20:18 ` [Caml-list] " Thomas Braibant
2012-12-20 20:32 ` [Caml-list] " Thomas Braibant
2012-12-20 21:01 ` Martin Jambon [this message]
2012-12-21 7:58 ` [Caml-list] " Jacques Garrigue
2012-12-21 10:02 ` Xavier Leroy
2012-12-21 19:03 ` Martin Jambon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50D37CB9.7020105@ens-lyon.org \
--to=martin.jambon@ens-lyon.org \
--cc=caml-list@inria.fr \
--cc=thomas.braibant@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox