summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/expl3/l3num.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-06-09 23:31:15 +0000
committerKarl Berry <karl@freefriends.org>2009-06-09 23:31:15 +0000
commit215b9a864d5829070bdc66ba736986eb72e5143e (patch)
treefe0882c81fc4ec945cee4b512f72eaa21ea5f791 /Master/texmf-dist/tex/latex/expl3/l3num.sty
parentdf90ec06321940c2f066b05e12f1b5ab099105da (diff)
expl3 1407 (9jun09)
git-svn-id: svn://tug.org/texlive/trunk@13686 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/expl3/l3num.sty')
-rw-r--r--Master/texmf-dist/tex/latex/expl3/l3num.sty145
1 files changed, 40 insertions, 105 deletions
diff --git a/Master/texmf-dist/tex/latex/expl3/l3num.sty b/Master/texmf-dist/tex/latex/expl3/l3num.sty
index e34d1f82280..f2a12228b84 100644
--- a/Master/texmf-dist/tex/latex/expl3/l3num.sty
+++ b/Master/texmf-dist/tex/latex/expl3/l3num.sty
@@ -15,7 +15,7 @@
%% Do not distribute a modified version of this file.
%%
%%
-%% File: l3num.dtx Copyright (C) 2005-2008 Frank Mittelbach, LaTeX3 project
+%% File: l3num.dtx Copyright (C) 2005-2009 Frank Mittelbach, LaTeX3 project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -33,7 +33,7 @@
%%
%% The development version of the bundle can be found at
%%
-%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/
+%% http://www.latex-project.org/svnroot/experimental/trunk/
%%
%% for those people who are interested.
%%
@@ -48,118 +48,53 @@
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3names}
-\GetIdInfo$Id: l3num.dtx 741 2008-08-01 13:37:16Z morten $
+\GetIdInfo$Id: l3num.dtx 1362 2009-05-28 20:19:21Z joseph $
{L3 Experimental token numbers}
\ProvidesExplPackage
{\filename}{\filedate}{\fileversion}{\filedescription}
-\RequirePackage{l3expan}\par
-\let_new:NN \num_value:w \tex_number:D
-\let_new:NN \num_eval:w \etex_numexpr:D
-\let_new:NN \num_eval_end: \scan_stop:
-\let_new:NN \if_num:w \tex_ifnum:D
-\let_new:NN \if_num_odd:w \tex_ifodd:D
-\let_new:NN \if_case:w \tex_ifcase:D
-\let_new:NN \or: \tex_or:D
-\def:Npn \num_incr:N #1{\num_add:Nn#1 1}
-\def:Npn \num_decr:N #1{\num_add:Nn#1 \c_minus_one}
-\def:Npn \num_gincr:N #1{\num_gadd:Nn#1 1}
-\def:Npn \num_gdecr:N #1{\num_gadd:Nn#1 \c_minus_one}
-\def_new:Npn \num_incr:c {\exp_args:Nc \num_incr:N}
-\def_new:Npn \num_decr:c {\exp_args:Nc \num_decr:N}
-\def_new:Npn \num_gincr:c {\exp_args:Nc \num_gincr:N}
-\def_new:Npn \num_gdecr:c {\exp_args:Nc \num_gdecr:N}
-\def_new:Npn \num_zero:N #1 {\num_set:Nn #1 0}
-\def_new:Npn \num_gzero:N #1 {\num_gset:Nn #1 0}
-\def_new:Npn \num_zero:c {\exp_args:Nc \num_zero:N}
-\def_new:Npn \num_gzero:c {\exp_args:Nc \num_gzero:N}
-\def_new:Npn \num_new:N #1{\tlp_new:Nn #1{0}}
-\def_new:Npn \num_new:c {\exp_args:Nc \num_new:N}
-\def_new:Npn \num_eval:n #1{\num_eval:w #1\num_eval_end:}
-\def_new:Npn \num_set:Nn #1#2{
- \tlp_set:No #1{ \tex_number:D \num_eval:n {#2} }
+\package_check_loaded_expl:
+\cs_new_eq:NN \if_num:w \tex_ifnum:D
+\cs_new_eq:NN \if_case:w \tex_ifcase:D
+\cs_set_nopar:Npn \num_incr:N #1{\num_add:Nn#1 1}
+\cs_set_nopar:Npn \num_decr:N #1{\num_add:Nn#1 \c_minus_one}
+\cs_set_nopar:Npn \num_gincr:N #1{\num_gadd:Nn#1 1}
+\cs_set_nopar:Npn \num_gdecr:N #1{\num_gadd:Nn#1 \c_minus_one}
+\cs_generate_variant:Nn \num_incr:N {c}
+\cs_generate_variant:Nn \num_decr:N {c}
+\cs_generate_variant:Nn \num_gincr:N {c}
+\cs_generate_variant:Nn \num_gdecr:N {c}
+\cs_new_nopar:Npn \num_zero:N #1 {\num_set:Nn #1 0}
+\cs_new_nopar:Npn \num_gzero:N #1 {\num_gset:Nn #1 0}
+\cs_generate_variant:Nn \num_zero:N {c}
+\cs_generate_variant:Nn \num_gzero:N {c}
+\cs_new_nopar:Npn \num_new:N #1{\tl_new:Nn #1{0}}
+\cs_generate_variant:Nn \num_new:N {c}
+\cs_new_nopar:Npn \num_set:Nn #1#2{
+ \tl_set:No #1{ \tex_number:D \intexpr_eval:n {#2} }
}
-\def_new:Npn \num_gset:Nn {\pref_global:D \num_set:Nn}
-\def_new:Npn \num_set:cn {\exp_args:Nc \num_set:Nn }
-\def_new:Npn \num_gset:cn {\exp_args:Nc \num_gset:Nn }
-\let_new:NN \num_set_eq:NN \tlp_set_eq:NN
-\def_new:Npn \num_set_eq:cN {\exp_args:Nc \num_set_eq:NN}
-\def_new:Npn \num_set_eq:Nc {\exp_args:NNc \num_set_eq:NN}
-\def_new:Npn \num_set_eq:cc {\exp_args:Ncc \num_set_eq:NN}
-\let_new:NN \num_gset_eq:NN \tlp_gset_eq:NN
-\def_new:Npn \num_gset_eq:cN {\exp_args:Nc \num_gset_eq:NN}
-\def_new:Npn \num_gset_eq:Nc {\exp_args:NNc \num_gset_eq:NN}
-\def_new:Npn \num_gset_eq:cc {\exp_args:Ncc \num_gset_eq:NN}
-\def_new:Npn \num_add:Nn #1#2 {\num_set:Nn #1{#1+#2}}
-\def_new:Npn \num_add:cn {\exp_args:Nc\num_add:Nn}
-\def_new:Npn \num_gadd:Nn {\pref_global:D \num_add:Nn}
-\def_new:Npn \num_gadd:cn {\exp_args:Nc\num_gadd:Nn}
-\let_new:NN\num_use:N \use_arg_i:n
-\let_new:NN\num_use:c \cs_use:c
-\def_test_function_new:npn {num_compare:nNn}#1#2#3{
- \if_num:w \num_eval:n {#1}#2\num_eval:n {#3}
-}
-\def_new:Npn \num_compare:cNcTF { \exp_args:NcNc\num_compare:nNnTF }
-\def_new:Npn \num_compare_p:nNn #1#2#3{
- \if_num:w \num_eval:n {#1}#2\num_eval:n {#3}
- \c_true
- \else:
- \c_false
- \fi:
-}
-\def_new:Npn \num_abs:n#1{
- \if_num:w \num_eval:n{#1}<\c_zero \exp_after:NN -\fi: #1
-}
-\def_new:Npn \num_max_of:nn#1#2{\num_compare:nNnTF {#1}>{#2}{#1}{#2}}
-\def_new:Npn \num_min_of:nn#1#2{\num_compare:nNnTF {#1}<{#2}{#1}{#2}}
-\def_long_new:Npn \num_elt_count:n #1 { + 1 }
-\def_long_new:Npn \num_elt_count_prop:Nn #1#2 { + 1 }
+\cs_generate_variant:Nn\num_set:Nn {c}
+\cs_new_nopar:Npn \num_gset:Nn {\pref_global:D \num_set:Nn}
+\cs_generate_variant:Nn\num_gset:Nn {c}
+\cs_new_eq:NN \num_set_eq:NN \tl_set_eq:NN
+\cs_generate_variant:Nn\num_set_eq:NN {c,Nc,cc}
+\cs_new_eq:NN \num_gset_eq:NN \tl_gset_eq:NN
+\cs_generate_variant:Nn\num_gset_eq:NN {c,Nc,cc}
+\cs_new_nopar:Npn \num_add:Nn #1#2 {\num_set:Nn #1{#1+#2}}
+\cs_generate_variant:Nn\num_add:Nn {c}
+\cs_new_nopar:Npn \num_gadd:Nn {\pref_global:D \num_add:Nn}
+\cs_generate_variant:Nn\num_gadd:Nn {c}
+\cs_new_eq:NN\num_use:N \use:n
+\cs_new_eq:NN\num_use:c \use:c
+\cs_new_eq:NN\num_show:N \cs_show:N
+\cs_new_eq:NN\num_show:c \cs_show:c
+\cs_new:Npn \num_elt_count:n #1 { + 1 }
+\cs_new:Npn \num_elt_count_prop:Nn #1#2 { + 1 }
\num_new:N \l_tmpa_num
\num_new:N \l_tmpb_num
\num_new:N \l_tmpc_num
\num_new:N \g_tmpa_num
\num_new:N \g_tmpb_num
-\engine_if_aleph:TF
-{
- \let_new:NN \const_new_aux:Nw \tex_chardef:D
- \const_new_aux:Nw \c_max_register_num = 65535 \scan_stop:
-}
-{
- \let_new:NN \const_new_aux:Nw \tex_mathchardef:D
- \const_new_aux:Nw \c_max_register_num = 32767 \scan_stop:
-}
-\def_new:Npn \const_new:Nn #1#2 {
- \num_compare:nNnTF {#2} > \c_minus_one
- {
- \num_compare:nNnTF {#2} > \c_max_register_num
- {\int_new:N #1 \int_set:Nn #1{#2}}
- {\chk_new_cs:N #1 \const_new_aux:Nw #1 = #2 \scan_stop: }
- }
- {\int_new:N #1 \int_set:Nn #1{#2}}
-}
- %% \tex_countdef:D \c_minus_one = 10 \scan_stop:
- %% \c_minus_one = -1 \scan_stop: %% in l3basics
- %% \tex_chardef:D \c_sixteen = 16\scan_stop: %% in l3basics
-\const_new:Nn \c_zero {0}
-\const_new:Nn \c_one {1}
-\const_new:Nn \c_two {2}
-\const_new:Nn \c_three {3}
-\const_new:Nn \c_four {4}
-\const_new:Nn \c_six {6}
-\const_new:Nn \c_seven {7}
-\const_new:Nn \c_nine {9}
-\const_new:Nn \c_ten {10}
-\const_new:Nn \c_eleven {11}
-\const_new:Nn \c_thirty_two {32}
-\const_new:Nn \c_hundred_one {101}
-\const_new:Nn \c_twohundred_fifty_five {255}
-\const_new:Nn \c_twohundred_fifty_six {256}
-\const_new:Nn \c_thousand {1000}
-\const_new:Nn \c_ten_thousand {10000}
-\const_new:Nn \c_ten_thousand_one {10001}
-\const_new:Nn \c_ten_thousand_two {10002}
-\const_new:Nn \c_ten_thousand_three {10003}
-\const_new:Nn \c_ten_thousand_four {10004}
-\const_new:Nn \c_twenty_thousand {20000}
+\tex_mathchardef:D \c_max_register_num = 32767 \scan_stop:
%%
%%
%% End of file `l3num.sty'.