summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/l3int.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-02-28 00:40:51 +0000
committerKarl Berry <karl@freefriends.org>2012-02-28 00:40:51 +0000
commit29c459636115f7de4ae9a8681927b52a1e896805 (patch)
tree5200a1da0c7a7bae64d8c07c48df4a5daf30323e /Master/texmf-dist/tex/latex/l3kernel/l3int.sty
parente20ea4bdd670e0418363a2a38a54b422a4d83231 (diff)
l3kernel 3471 (26feb12)
git-svn-id: svn://tug.org/texlive/trunk@25525 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3int.sty')
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3int.sty40
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
{