On 20140505 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 eTeX's \dimexpr,
>> from "The eTeX 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 64bit 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 units. 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
