Sender: |
|
Date: |
Mon, 5 May 2014 11:04:05 +0200 |
Reply-To: |
|
Message-ID: |
|
Subject: |
|
MIME-Version: |
1.0 |
Content-Transfer-Encoding: |
8bit |
In-Reply-To: |
|
Content-Type: |
text/plain; charset=utf-8 |
From: |
|
Parts/Attachments: |
|
|
Frank Mittelbach <[log in to unmask]> writes:
> Am 05.05.2014 01:08, schrieb Heiko Oberdiek:
>> 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
>
>
> perhaps I'm completely off the mark, but isn't this introducing a
> restriction on the values that can be entered? (ie generating an
> overflow by doing *800 first)
You are completely off the mark. Let me reinstate what you cut from
Heiko's posting:
>> 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 ‘scaling’ operations (a multiplication immediately followed
>> | by a division) which are performed as one combined operation
>> | with a 64-bit product as intermediate value.
--
David Kastrup
|
|
|