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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 7641A7EEBF for ; Thu, 23 Jul 2015 10:46:14 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.15,529,1432591200"; d="scan'208";a="140954666" Received: from meleze.ens.fr (HELO [129.199.99.114]) ([129.199.99.114]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 23 Jul 2015 10:46:14 +0200 Message-ID: <55B0A9D5.4000008@inria.fr> Date: Thu, 23 Jul 2015 10:46:13 +0200 From: Francois Berenger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: OCaml List References: <20150723083517.GA2029@pl-59055.rocqadm.inria.fr> In-Reply-To: <20150723083517.GA2029@pl-59055.rocqadm.inria.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] Comparing floats On 07/23/2015 10:35 AM, Sébastien Hinderer wrote: > Dear all, > > What's the most efficient way to compare floats, please? > Is it the polymorphic compare function, or is there a more specialized > version of it? > > I saw Float.compare mentionned on the web but that does not seem to exist > any longer? It exists in Batteries for sure and in Core I believe. Also, maybe you can define: let cmp_f (x: float) (y: float) = x -. y > Thanks, > > Sébastien. > -- Regards, Francois. "When in doubt, use more types"