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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 1E85B7F008 for ; Thu, 26 May 2016 11:16:20 +0200 (CEST) IronPort-PHdr: 9a23:iqH32RBpVRgmhh7oRpgcUyQJP3N1i/DPJgcQr6AfoPdwSP/7pMbcNUDSrc9gkEXOFd2CrakU2qyK7uu4CCQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTmkbzvsMWCKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46Fp34d6XK77Z6U1S6BDRHRjajhtpZ6jiR6WfQKR53YGGkEbiB1ZS1zV5Q/7U423tibgsftV2S+APMSwQ6piHXyp5qJvDRvpkzsvNjgj8WiRhNYjorhcpUeEoBx2xoPYKKCaKfdkeKfUedpSEWtOQ8tLESVcHoSUYI4GDu5HNuFd+dqu72ASpAezUFH/TNjkzSVF0zqvhfU3 Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=iguer.auto@gmail.com; spf=Pass smtp.mailfrom=iguer.auto@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f45.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of iguer.auto@gmail.com) identity=pra; client-ip=74.125.82.45; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="iguer.auto@gmail.com"; x-sender="iguer.auto@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of iguer.auto@gmail.com designates 74.125.82.45 as permitted sender) identity=mailfrom; client-ip=74.125.82.45; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="iguer.auto@gmail.com"; x-sender="iguer.auto@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wm0-f45.google.com) identity=helo; client-ip=74.125.82.45; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="iguer.auto@gmail.com"; x-sender="postmaster@mail-wm0-f45.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0B5AQB1vUZXfy1SfUpchQylSAEBBokXjRuGEQKBOTsRAQEBAQEBAQERAQEJCwsJIS+CLoIWAQEEEhEPAQUIARscAgMMBgULDQICBRYLAgIJAwIBAgEREQEFARwGAQwIAQEeh3IBAxekCYExPjGLO4FqglgFh3sKGScNUoNbAQEBAQEFAQEBAQEBARgCBhBxhF6FFIdAglkBBJg3jiBlgQSET4J7DoVbRY1IMIEPNoIlgXZsihUBAQE X-IPAS-Result: A0B5AQB1vUZXfy1SfUpchQylSAEBBokXjRuGEQKBOTsRAQEBAQEBAQERAQEJCwsJIS+CLoIWAQEEEhEPAQUIARscAgMMBgULDQICBRYLAgIJAwIBAgEREQEFARwGAQwIAQEeh3IBAxekCYExPjGLO4FqglgFh3sKGScNUoNbAQEBAQEFAQEBAQEBARgCBhBxhF6FFIdAglkBBJg3jiBlgQSET4J7DoVbRY1IMIEPNoIlgXZsihUBAQE X-IronPort-AV: E=Sophos;i="5.26,367,1459807200"; d="scan'208";a="219818479" Received: from mail-wm0-f45.google.com ([74.125.82.45]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 26 May 2016 11:16:19 +0200 Received: by mail-wm0-f45.google.com with SMTP id z87so91259784wmh.0; Thu, 26 May 2016 02:16:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=hVBwfVFLirvO3fLcrLkLtQennCKORNuXoNgZxkw5N9E=; b=Xe95X56fkk6Rz7QjWtkWh9GyERVqU9IOGyuramuCVqk1dtpUOYjvKjAa78P8hG2/nQ zmm58QLcONu+CNfy/dnPprvHDRPo0UOqbPNUQSd5gkN6DrFeD0KcxtTSMD+o9lJhVfE/ RfOichxV66O1/+VNhqU4nBModjW+4hSBFFKwqPFLoFizij6guGIZcdmE/r8d3nFjGVSG ygyoquZ3iBphuHiffDnKFE0GmLry1yVXNN3Fl5JlmihHAO/Ejl4A6kGqWmPSnSrFLMzY MML7E0PZz09pr2xtKRv37FV631iXGQH1j7KqYXwoinK7ju+bXoClOnKe9UvaZAz2V5Eg CWtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=hVBwfVFLirvO3fLcrLkLtQennCKORNuXoNgZxkw5N9E=; b=mPovMpN+5n9Jx64Di3iKlil59ChNiS77p7cVjBqC7tWPVjPME8oDCwV+Lki3jf3Ezb 5L9Uvld/rm/APIawWgE3XYk4/vhLpDqBkMDE7QGP7m2N1wmTQfM6qByWuP9k5rgMDUst ZtMq60Tht0Rnlk0bzoRYyBTSCgXcaAu6jP8G7M1eehHa8CGzKSbYf7t0xHPVqBO+5Hr4 Erl3pnozzhCqotL8p80Vw2djfeH7pCeW1V4saF53RfpgrcC65UKJqhC+8lFr8TOrxhnb Y0vbTlMS6DNCq0ez5VTPctdt5cZMSSagpCCaJ3MrAmdJ08C2YVtYrzRNnJOlsAud2sbE wBuA== X-Gm-Message-State: ALyK8tKJ7TUXlOoVRD7Y9VNer5dWsEPqEAco4xjArga3ZqaQ93UiCpW/OHG7wTTPTiuseA== X-Received: by 10.194.143.51 with SMTP id sb19mr9642967wjb.175.1464254179271; Thu, 26 May 2016 02:16:19 -0700 (PDT) Received: from [129.175.29.53] (lri29-53.lri.fr. [129.175.29.53]) by smtp.gmail.com with ESMTPSA id w3sm13310238wjt.0.2016.05.26.02.16.18 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 May 2016 02:16:18 -0700 (PDT) To: Xavier Leroy , caml-list@inria.fr References: <5746B2C7.2030608@gmail.com> <5746BA85.4030100@inria.fr> From: Mohamed Iguernlala Message-ID: <5746BEE2.3020907@gmail.com> Date: Thu, 26 May 2016 11:16:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <5746BA85.4030100@inria.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] Is this a bug in Num.float_of_num ? Le 26/05/2016 10:57, Xavier Leroy a écrit : > On 26/05/2016 10:24, Mohamed Iguernlala wrote: >> Hi, >> >> I came to the following "stange" behavior when using the function >> float_of_num. I don't know if this should be considered as a bug, >> since this function has no specification (in num.mli *) >> >> The float "f = 6004799503160661. /. 18014398509481984." has an >> exact representation on 64 bits. Its value is >> >> 0.333333333333333314829616256247390992939472198486328125 >> >> However, when using float_of_num to compute the float corresponding to >> the number above represented as a num, the result is slightly different. > float_of_ratio and float_of_num are very imprecise in OCaml 4.02 and > earlier. They were reimplemented in OCaml 4.03 in a way that should > give correct roundings. So, make sure you're using 4.03, and if the > bug is still there, please file a report on Mantis. Thanks, the result is correct with OCaml 4.03.0. I hadn't tried before because the constant "let floating_precision = ref 12" is still there in OCaml 4.03.0 ... Sorry. Regards, Mohamed.