diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2008-07-29 11:23:34 +0000 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2008-07-29 11:23:34 +0000 |
commit | ef285e6a49a93af098150d0b3125a34d3477ba55 (patch) | |
tree | 124a55595390d358e0cda8ae26f78e9a263e9a21 /Master/texmf-dist/source/latex/expl3/l3num.dtx | |
parent | e7477f362711cc9d05dfa1ee71301fb34cce2d94 (diff) |
expl3 update (2008/06/20)
git-svn-id: svn://tug.org/texlive/trunk@9869 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/expl3/l3num.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/expl3/l3num.dtx | 88 |
1 files changed, 72 insertions, 16 deletions
diff --git a/Master/texmf-dist/source/latex/expl3/l3num.dtx b/Master/texmf-dist/source/latex/expl3/l3num.dtx index e74c57db79b..624cd7668e5 100644 --- a/Master/texmf-dist/source/latex/expl3/l3num.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3num.dtx @@ -32,26 +32,21 @@ %% %% ----------------------------------------------------------------------- % -%<package>\RequirePackage{l3names} -%<*dtx> +%<*driver|package> +\RequirePackage{l3names} +%</driver|package> %\fi -\def\GetIdInfo$Id: #1.dtx #2 #3-#4-#5 #6 #7$#8{% - \def\fileversion{#2}% - \def\filedate{#3/#4/#5}% - \ProvidesFile{#1.dtx}[#3/#4/#5 v#2 #8]% -} -%\iffalse -%</dtx> -%\fi -\GetIdInfo$Id: l3num.dtx 573 2006-08-21 20:59:37Z morten $ +\GetIdInfo$Id: l3num.dtx 702 2007-11-27 14:21:49Z morten $ {L3 Experimental token numbers} -% -% \iffalse +%\iffalse %<*driver> +%\fi +\ProvidesFile{\filename.\filenameext} + [\filedate\space v\fileversion\space\filedescription] +%\iffalse \documentclass{l3doc} - \begin{document} -\DocInput{l3num.dtx} +\DocInput{\filename.\filenameext} \end{document} %</driver> % \fi @@ -159,7 +154,9 @@ % % \begin{function}{% % \num_add:Nn | +% \num_add:cn | % \num_gadd:Nn | +% \num_gadd:cn | % } % \begin{syntax} % "\num_add:Nn" <num> "{" <integer> "}" @@ -222,6 +219,25 @@ % A predicate version of the above functions. % \end{function} % +% \begin{function}{% +% \num_max_of:nn | +% \num_min_of:nn | +% } +% \begin{syntax} +% "\num_max_of:nn" "{"<num~expr>"}" "{"<num~expr>"}" +% \end{syntax} +% Return the largest or smallest of two \m{num} expressions. +% \end{function} +% +% \begin{function}{% +% \num_abs:n | +% } +% \begin{syntax} +% "\num_abs:n" "{"<num~expr>"}" +% \end{syntax} +% Return the numerical value of a \m{num} expression. +% \end{function} + % % \subsection{Formatting a counter value} % @@ -283,6 +299,20 @@ % % % \begin{function}{% +% \num_value:w | +% } +% \begin{syntax} +% "\num_value:w" <integer> \\ +% "\num_value:w" <tokens> <optional space> +% \end{syntax} +% Expands <tokens> until an <integer> is formed. One space may be +% gobbled in the process. Preferably use with "\num_eval:n". +% \begin{texnote} +% This is the \TeX{} primitive \tn{number}. +% \end{texnote} +% \end{function} +% +% \begin{function}{% % \num_eval:w | % } % \begin{syntax} @@ -345,11 +375,14 @@ % % We start by ensuring that the required packages are loaded. % \begin{macrocode} +%<package>\ProvidesExplPackage +%<package> {\filename}{\filedate}{\fileversion}{\filedescription} %<package&!check>\RequirePackage{l3expan}\par %<package&check>\RequirePackage{l3chk}\par %<*initex|package> % \end{macrocode} % +% \begin{macro}{\num_value:w} % \begin{macro}{\num_eval:w} % \begin{macro}{\if_num:w} % \begin{macro}{\if_num_odd:w} @@ -358,6 +391,7 @@ % Here are the remaining primitives for number comparisons and % expressions. % \begin{macrocode} +\let_new:NN \num_value:w \tex_number:D \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 @@ -369,6 +403,7 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \begin{macro}{\use_arg_after_or:w} % \begin{macro}{\use_arg_after_else:w} @@ -514,15 +549,21 @@ % \end{macro} % % \begin{macro}{\num_add:Nn} +% \begin{macro}{\num_add:cn} % \begin{macro}{\num_gadd:Nn} +% \begin{macro}{\num_gadd:cn} % Adding is easily done as the second argument goes through % |\num_eval:n|. % \begin{macrocode} \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} % \end{macrocode} % \end{macro} % \end{macro} +% \end{macro} +% \end{macro} % % % \begin{macro}{\num_use:N} @@ -563,6 +604,21 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\num_max_of:nn} +% \begin{macro}{\num_min_of:nn} +% \begin{macro}{\num_abs:n} +% Functions for $\min$, $\max$, and absolute value. +% \begin{macrocode} +\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}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% % \begin{macro}{\l_tmpa_num} % \begin{macro}{\l_tmpb_num} % \begin{macro}{\l_tmpc_num} @@ -593,7 +649,7 @@ % \begin{macro}{\const_new_aux:Nw} % \begin{macrocode} % \begin{macrocode} -\engine_aleph:TF +\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: |