Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id s472EFN6019404 for ; Wed, 7 May 2014 04:14:16 +0200 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx113) with ESMTPS (Nemesis) id 0MV2DB-1WKZqh0TbJ-00YQtY for ; Wed, 07 May 2014 04:14:10 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id s472B9ai011823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 7 May 2014 04:11:09 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s46M13t4001573; Wed, 7 May 2014 04:11:08 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 10865360 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 7 May 2014 04:11:08 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s472B8H9005111 for ; Wed, 7 May 2014 04:11:08 +0200 Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id s472Apdb011747 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Wed, 7 May 2014 04:10:55 +0200 Received: by mail-pd0-f178.google.com with SMTP id r10so350207pdi.9 for ; Tue, 06 May 2014 19:10:51 -0700 (PDT) X-Received: by 10.66.216.137 with SMTP id oq9mr12919097pac.97.1399428651104; Tue, 06 May 2014 19:10:51 -0700 (PDT) Received: from [192.168.1.11] ([27.9.27.39]) by mx.google.com with ESMTPSA id ha3sm182220pbc.5.2014.05.06.19.10.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 May 2014 19:10:50 -0700 (PDT) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 References: <5366C875.9040709@googlemail.com> <5367453E.3030906@morningstar2.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Message-ID: <5369962B.2020905@gmail.com> Date: Wed, 7 May 2014 10:10:51 +0800 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Qing Lee Subject: Re: \__dim_strip_bp:n To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <5367453E.3030906@morningstar2.co.uk> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by relay.uni-heidelberg.de id s472B9ai011823 Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:e9uMs6vGIs8=:N6nEdexzzpILCf49MbzRQQp4Jh oQBwIzDmpv03/gj/kXGLi2pXXOlMr/X1O4lwLo98sQvg8slcUkaQ6MVPPJm5w45RCVrn7Ozmf bsqeXPi5QHiP1LoU9aaXGI1rouECjnbYQN36ytPz88v3m6GqoDU5xMvzqbTqP6zoNIqYfvK6x UqEqtyuRUHsNq+vRsKDKYGT9oBNe0W2AOY2a7mLg1YfJzBwq1QCA25Qfy4SsBEwuGNiiUCP33 bbmKhGHKxw85xixbEqNZf0yQm6z+DN+1LFWIiBq7HQAiPEr5qbShPiQZqjFm3KMJP1Y5rtAi8 hALKUuLmOJRYmVDsPCN8JHRnvAh8P39zP13Np1yqmi4U4+HhaiEKD3TGx7ItxnIdViwJOPcKm 2oIOslhRTw59KA4LOxotF6nNHPTVjR1zeAKjyShELZF1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ii6n1PIRq8=:GI/Ad39vMHAis9gomXvVzPqU3BKYk6CdR2ccAi8OdWI= Status: R X-Status: X-Keywords: X-UID: 7397 On 2014-05-05 at 16:01:02 +0800 GMT, Joseph Wright wrote: > On 05/05/2014 00:08, Heiko Oberdiek wrote: >> Hello, >> >> macro \__dim_strip_bp:n is defined in l3skip.dtx the following way: >> >> \cs_new:Npn \__dim_strip_bp:n #1 >> { \__dim_strip_pt:n { 0.996 26 \__dim_eval:w #1 \__dim_eval_end: = } } >> >> The calculation from bp to bp is essentially: >> >> \dimexpr 0.99626\dimexpr #1\relax\relax >> >> Of course, there will always be rounding errors, but the code >> can be improved by a scaling operation inside e-TeX's \dimexpr, >> from "The e-TeX manual": >> >> | The arithmetic operations are performed individually, except >> | for =E2=80=98scaling=E2=80=99 operations (a multiplication immediate= ly followed >> | by a division) which are performed as one combined operation >> | with a 64-bit product as intermediate value. >> >> Improved version with higher precision: >> >> \cs_new:Npn \__dim_strip_bp:n #1 >> { >> \__dim_strip_pt:n >> { >> \__dim_eval:w ( #1 ) * 800 / 803 \__dim_eval_end: >> } >> } >> >> * 800/803 is the integer fraction for 72/72.27 >> * The parentheses around #1 ensure, that #1 is >> calculated first. >> >> Yours sincerely >> Heiko Oberdiek >> > > Altered in the trunk: will feature in the next release. > -- > Joseph Wright > Hello, The new definition will be broken if its argument contains additional uni= ts. E.g., \__dim_strip_bp:n { 1 bp pt } So I think the proper definition is similarly: \cs_new:Npn \@@_strip_bp:n #1 { \@@_strip_pt:n { \@@_strip_pt:n {#1} pt * 800 / 803 \@@_eval_end: } } Best Regards, Qing Lee