summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/expl3/l3num.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-05-22 17:46:23 +0000
committerKarl Berry <karl@freefriends.org>2007-05-22 17:46:23 +0000
commitf4eb27d3314d15838f674a3872000159d029f88b (patch)
tree6e9ab33c5a2d702912b4a969ade4e4e2ac586d62 /Master/texmf-dist/tex/latex/expl3/l3num.sty
parent14af3f447439750920f754792b89f113d019076a (diff)
update expl3
git-svn-id: svn://tug.org/texlive/trunk@4335 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.sty155
1 files changed, 155 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/expl3/l3num.sty b/Master/texmf-dist/tex/latex/expl3/l3num.sty
new file mode 100644
index 00000000000..3392ecd86f2
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/expl3/l3num.sty
@@ -0,0 +1,155 @@
+%%
+%% This is file `l3num.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% l3num.dtx (with options: `package,trace')
+%%
+%%
+%% EXPERIMENTAL CODE
+%%
+%% Do not distribute this file without also distributing the
+%% source files specified above.
+%%
+%% Do not distribute a modified version of this file.
+%%
+%%
+%% File: l3num.dtx Copyright (C) 2005-2006 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
+%% license or (at your option) any later version. The latest version
+%% of this license is in the file
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% This file is part of the ``expl3 bundle'' (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+\RequirePackage{l3names}
+\GetIdInfo$Id: l3num.dtx 573 2006-08-21 20:59:37Z morten $
+ {L3 Experimental token numbers}
+\RequirePackage{l3expan}\par
+\let_new:NN \num_eval:w \etex_numexpr:D
+\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_long_new:Npn \use_arg_after_or:w #1\or: #2\fi:{\fi: #1}
+\def_long_new:Npn \use_arg_after_else:w #1\else: #2\fi:{\fi: #1}
+\def_long_new:Npn \use_arg_after_fi:w #1\fi:{\fi: #1}
+\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\scan_stop:}
+\def_new:Npn \num_set:Nn #1#2{
+ \tlp_set:No #1{ \tex_number:D \num_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_gadd:Nn {\pref_global:D \num_add: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:
+}
+\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_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}
+%%
+%%
+%% End of file `l3num.sty'.