diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3int.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3int.sty | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3int.sty b/Master/texmf-dist/tex/latex/l3kernel/l3int.sty index 2747a0afeeb..f12cda36783 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3int.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3int.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3int.dtx 3315 2012-02-06 11:17:04Z bruno $ +\GetIdInfo$Id: l3int.dtx 3460 2012-02-26 12:16:41Z will $ {L3 Experimental integers} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -90,29 +90,25 @@ } \cs_new:Npn \int_div_truncate:nn #1#2 { - \int_value:w \int_eval:w - \if_int_compare:w \int_eval:w #1 = \c_zero - 0 - \else: - ( #1 % ) - \if_int_compare:w \int_eval:w #1 < \c_zero - \if_int_compare:w \int_eval:w #2 < \c_zero - - ( #2 + % ) - \else: - + ( #2 - % ) - \fi: - \else: - \if_int_compare:w \int_eval:w #2 < \c_zero - + ( #2 + % ) - \else: - - ( #2 - % ) - \fi: - \fi: % ( ( - 1 ) / 2 ) - \fi: - / ( #2 ) + \int_use:N \int_eval:w + \exp_after:wN \int_div_truncate_aux:NwNw + \int_use:N \int_eval:w #1 \exp_after:wN ; + \int_use:N \int_eval:w #2 ; \int_eval_end: } +\cs_new:Npn \int_div_truncate_aux:NwNw #1#2; #3#4; + { + \if_meaning:w 0 #1 + \c_zero + \else: + ( + #1#2 + \if_meaning:w - #1 + \else: - \fi: + ( \if_meaning:w - #3 - \fi: #3#4 - \c_one ) / \c_two + ) + \fi: + / #3#4 + } \cs_new:Npn \int_div_round:nn #1#2 { \int_eval:n { ( #1 ) / ( #2 ) } } \cs_new:Npn \int_mod:nn #1#2 { |