From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 128507F0EF for ; Thu, 28 Jan 2016 20:03:27 +0100 (CET) IronPort-PHdr: 9a23:rLpGkhJMQ99ezMWd5NmcpTZWNBhigK39O0sv0rFitYgUKfnxwZ3uMQTl6Ol3ixeRBMOAu60C07ad6vmwEUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35vxj7z5osSDKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46FppIZ8VvDxdqE8CLhZFygOMmYv5cStuwOQYxGI4y4EX2QR2k5QDgnCqhv9RIvxvy/+u8Jy3SCbOYv9SrViCmfq1LtiVBK90HRPDDU+6myC0sE= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=peio.borthelle@gmail.com; spf=Pass smtp.mailfrom=peio.borthelle@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f42.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of peio.borthelle@gmail.com) identity=pra; client-ip=74.125.82.42; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="peio.borthelle@gmail.com"; x-sender="peio.borthelle@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of peio.borthelle@gmail.com designates 74.125.82.42 as permitted sender) identity=mailfrom; client-ip=74.125.82.42; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="peio.borthelle@gmail.com"; x-sender="peio.borthelle@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wm0-f42.google.com) identity=helo; client-ip=74.125.82.42; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="peio.borthelle@gmail.com"; x-sender="postmaster@mail-wm0-f42.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CuAgACZapWmypSfUpegw99bYhXpnKKYIFiIoVtAoFIOhIBAQEBAQEBARABAQEBAQYLCwkhLkESAYFZghUBAQMBEhEPAQ0BGx4DAQsGBQsPAiYCAiMRAQUBHDuHYwEDCggBDaMDgTE+MYs0gWmCV4V0ChknDVGDUAEBAQcBAQEBARUBBQoEbYlJhH6CNIE6BZZugXUBg1GIBIIlhmyFYI0BL4ENJweCKR6BWGkBghWGZwEBAQ X-IPAS-Result: A0CuAgACZapWmypSfUpegw99bYhXpnKKYIFiIoVtAoFIOhIBAQEBAQEBARABAQEBAQYLCwkhLkESAYFZghUBAQMBEhEPAQ0BGx4DAQsGBQsPAiYCAiMRAQUBHDuHYwEDCggBDaMDgTE+MYs0gWmCV4V0ChknDVGDUAEBAQcBAQEBARUBBQoEbYlJhH6CNIE6BZZugXUBg1GIBIIlhmyFYI0BL4ENJweCKR6BWGkBghWGZwEBAQ X-IronPort-AV: E=Sophos;i="5.22,359,1449529200"; d="scan'208";a="162040822" Received: from mail-wm0-f42.google.com ([74.125.82.42]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 28 Jan 2016 20:03:26 +0100 Received: by mail-wm0-f42.google.com with SMTP id p63so38588812wmp.1 for ; Thu, 28 Jan 2016 11:03:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:date:in-reply-to:references:content-type :mime-version:content-transfer-encoding; bh=w9dhywqa7CLoksnlENV4qMR3A3G3hL2sAXf8N9+Ubjc=; b=iviCivji5cJV47Mi/lob4chKRoF2Aiio3Q9tCr5SQ6yrGer7uduIBPQ9JhmSSUmOod M7HzB9eZhyI/krlKIXjhby9RpMr+N/syOX7vZQnCMB9SPL2kkHFWj1ZB+9zkLYDcvgKs 2tTdTw3wn1hd69kVtiv6ooGU2SK+bBj6QVK7KQpaReQOTVIahfUtVgX+U3BHpAZYwhBa fAXCraWdZuABmc/gTRYlWPAFKf3yR76unTLgdXf6DP2qVLoaWcygfI3K+JMTxgs2Ng0i mMVNPVbT9430LKBfJP2OBczkUvG204bEvMJDa7ihHQaq2dOL0eFKPQbNAXmgYpRzAuKF rXZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:content-type:mime-version:content-transfer-encoding; bh=w9dhywqa7CLoksnlENV4qMR3A3G3hL2sAXf8N9+Ubjc=; b=N+1nGoyNUVfJmY6WuDMzfHwbUCPP2YrY6lQVFj4c3caCtHwrexrFK0YZ7NIlpmYIYI tFdSHVP7Nj2ic29IHQ4Hxhh47XnPW/A9gu+u6ZQqNG4S2KNh5Vg32os7/G72B+MLONZC D8P7A7L8US0EDvYbtBDG67aqjv9XdhY4dD1QsrU3Ajh24CNRSwL1yqS+sAjtDy8UMrf3 qNwsugnSC/in1qFHAVpYkq5BuCqyyFXsbuNLfUJzwVsEUjzzsfvZC4lPZ5ehJnPEc7ha LXVdva3Q+VCTPCRDFlCri+B/IvZ6It/ww/+dWQW39FqwB5wc70m1771YBzGl43T0aZky 2FJg== X-Gm-Message-State: AG10YORmiUX/mNI2TWqKS22yCWkFD680vdooH+chClHzHMySQWx1Vu/xiQRXj1cze3jpKg== X-Received: by 10.194.118.138 with SMTP id km10mr5234306wjb.57.1454007806160; Thu, 28 Jan 2016 11:03:26 -0800 (PST) Received: from anung-un-rama.localdomain ([2a01:e35:2eb2:3960:6e40:8ff:fe8a:b944]) by smtp.googlemail.com with ESMTPSA id t3sm12335332wjz.11.2016.01.28.11.03.24 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jan 2016 11:03:25 -0800 (PST) Message-ID: <1454007804.4675.38.camel@gmail.com> From: peio To: caml-list@inria.fr Date: Thu, 28 Jan 2016 20:03:24 +0100 In-Reply-To: <56A8995A.3030304@inria.fr> References: <1453854887.31205.2.camel@gmail.com> <56A8995A.3030304@inria.fr> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.4 (3.18.4-1.fc23) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] truncated division, remainder and arithmetics > All contemporary microprocessors that implement division in hardware > implement what you call truncated division.  The other forms of > division and modulus (there are at least two others) can be > implemented on top of that.  See this excellent summary: > > Daan Leijen, Division and Modulus for Computer Scientists , July > 2003. > http://research.microsoft.com/apps/pubs/default.aspx?id=151917 Indeed I missed the fact of the processor available instructions. Thanks for the clarification and for the reference. Interestingly Leijen writes about optimisations possible with the euclidean division which could maybe lead to easier hardware implementation, but this surely is such a small simplification that instruction sets are sticking to the truncated one due to inertia of backward- compatibility.. > If you are doing computation with big numbers perhaps you can take a > look at zarith, which define  > many of the different division convention I didn't knew about zarith and it seems interesting even if this is an overkill for me. cheers, peio