From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id D9D757F2AA for ; Thu, 20 Dec 2012 22:01:48 +0100 (CET) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of martin.jambon@ens-lyon.org) identity=pra; client-ip=66.111.4.28; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="martin.jambon@ens-lyon.org"; x-sender="martin.jambon@ens-lyon.org"; x-conformance=sidf_compatible Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of martin.jambon@ens-lyon.org) identity=mailfrom; client-ip=66.111.4.28; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="martin.jambon@ens-lyon.org"; x-sender="martin.jambon@ens-lyon.org"; x-conformance=sidf_compatible Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@out4-smtp.messagingengine.com) identity=helo; client-ip=66.111.4.28; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="martin.jambon@ens-lyon.org"; x-sender="postmaster@out4-smtp.messagingengine.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ak0CAP1701BCbwQclGdsb2JhbABFg0iCcrc2Fg4BAQEBCQsJCRQEI4IeAQEFIxUIOAEBDwsYAgIFFgsCAgkDAgECAUUGDQEHAQGID6VucINQj0QGgSKLNYMwgROIZZMUjXI X-IronPort-AV: E=Sophos;i="4.84,326,1355094000"; d="scan'208";a="187115072" Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 20 Dec 2012 22:01:48 +0100 Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id DB8EB2095C; Thu, 20 Dec 2012 16:01:46 -0500 (EST) Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 20 Dec 2012 16:01:46 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=nPstuTOD6lb5KwE+QBXxmE s4D5Q=; b=jiP8/kFjOFutNGnE8KpPVBDE/HEeXnK/6wEVw8By8zpLJJmO0saq8w x0h0EhPnxerUzfL0wd/FjxD2YlzoI+4zOBY7UXbDv91SN7mnXU1GHpZ8XTdPrUFZ hcHdn6whBcaqcmvhGKo8eZDyhUqT29Bq8kuGtD90n6qQIZS0+G1c8= X-Sasl-enc: ADJ9FS9TRFUU5ZXNa7ZIckt8jWSVKKkanqaK32KgZ1ak 1356037306 Received: from [192.168.1.123] (unknown [50.76.32.210]) by mail.messagingengine.com (Postfix) with ESMTPA id 4917A8E06E4; Thu, 20 Dec 2012 16:01:46 -0500 (EST) Message-ID: <50D37CB9.7020105@ens-lyon.org> Date: Thu, 20 Dec 2012 13:01:45 -0800 From: Martin Jambon User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: Thomas Braibant CC: caml-list@inria.fr References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Re: Hashing failure 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