From 87c1785b0399e6f7464638214c13c34e7dfb6df1 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 7 Nov 2010 23:49:09 +0000 Subject: expl3 (7nov10) git-svn-id: svn://tug.org/texlive/trunk@20360 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/expl3/expl3.pdf | Bin 497716 -> 497704 bytes Master/texmf-dist/doc/latex/expl3/l3calc.pdf | Bin 377245 -> 377232 bytes Master/texmf-dist/doc/latex/expl3/source3.pdf | Bin 1520170 -> 1522696 bytes Master/texmf-dist/source/latex/expl3/l3fp.dtx | 128 +++++++++++++++--------- Master/texmf-dist/source/latex/expl3/l3int.dtx | 7 +- Master/texmf-dist/source/latex/expl3/l3keys.dtx | 42 +++++++- Master/texmf-dist/source/latex/expl3/l3tl.dtx | 86 ++++++++-------- Master/texmf-dist/tex/latex/expl3/l3fp.sty | 97 +++++++++++------- Master/texmf-dist/tex/latex/expl3/l3int.sty | 7 +- Master/texmf-dist/tex/latex/expl3/l3keys.sty | 14 ++- Master/texmf-dist/tex/latex/expl3/l3tl.sty | 80 +++++++-------- 11 files changed, 297 insertions(+), 164 deletions(-) diff --git a/Master/texmf-dist/doc/latex/expl3/expl3.pdf b/Master/texmf-dist/doc/latex/expl3/expl3.pdf index 74c826b27ad..1ed8e567085 100644 Binary files a/Master/texmf-dist/doc/latex/expl3/expl3.pdf and b/Master/texmf-dist/doc/latex/expl3/expl3.pdf differ diff --git a/Master/texmf-dist/doc/latex/expl3/l3calc.pdf b/Master/texmf-dist/doc/latex/expl3/l3calc.pdf index b7036a4eb30..c16f37aab80 100644 Binary files a/Master/texmf-dist/doc/latex/expl3/l3calc.pdf and b/Master/texmf-dist/doc/latex/expl3/l3calc.pdf differ diff --git a/Master/texmf-dist/doc/latex/expl3/source3.pdf b/Master/texmf-dist/doc/latex/expl3/source3.pdf index 28f5a7499ad..6ddf8f12d3e 100644 Binary files a/Master/texmf-dist/doc/latex/expl3/source3.pdf and b/Master/texmf-dist/doc/latex/expl3/source3.pdf differ diff --git a/Master/texmf-dist/source/latex/expl3/l3fp.dtx b/Master/texmf-dist/source/latex/expl3/l3fp.dtx index 9d9a06d7272..e8ecdad5480 100644 --- a/Master/texmf-dist/source/latex/expl3/l3fp.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3fp.dtx @@ -35,7 +35,7 @@ \RequirePackage{l3names} % %\fi -\GetIdInfo$Id: l3fp.dtx 2029 2010-09-19 13:59:02Z joseph $ +\GetIdInfo$Id: l3fp.dtx 2080 2010-10-27 11:02:09Z joseph $ {L3 Experimental floating-point operations} %\iffalse %<*driver> @@ -3779,9 +3779,10 @@ %\begin{macro}[aux]{\fp_compare_aux:N} %\begin{macro}[aux]{\fp_compare_=:} %\begin{macro}[aux]{\fp_compare_<:} -%\begin{macro}[aux]{\fp_compare_>:} +%\begin{macro}[aux]{\fp_compare_<_aux:} %\begin{macro}[aux]{\fp_compare_absolute_a>b:} %\begin{macro}[aux]{\fp_compare_absolute_a:} % The idea for the comparisons is to provide two versions: slower and % faster. The lead off for both is the same: get the two numbers % read and then look for a function to handle the comparison. @@ -3852,61 +3853,79 @@ \tex_fi:D } % \end{macrocode} -% For comparators life is a lot more complex, as there are three cases -% for the integer part (equality as well as greater and less than). The -% code here is quite repetitive to keep speed up, and simply does -% exhaustive checks. +% Comparing two values is quite complex. First, there is a filter step +% to check if one or other of the given values is zero. If it is then +% the result is relatively easy to determine. % \begin{macrocode} \cs_new_protected_nopar:cpn { fp_compare_>: } { - \tex_ifnum:D \l_fp_input_a_sign_int > \l_fp_input_b_sign_int - \group_end: - \prg_return_true: - \tex_else:D - \tex_ifnum:D \l_fp_input_a_sign_int < \l_fp_input_b_sign_int + \tex_ifnum:D \etex_numexpr:D + \l_fp_input_a_integer_int + \l_fp_input_a_decimal_int + = \c_zero + \tex_ifnum:D \etex_numexpr:D + \l_fp_input_b_integer_int + \l_fp_input_b_decimal_int + = \c_zero \group_end: \prg_return_false: \tex_else:D - \tex_ifnum:D \l_fp_input_a_sign_int > \c_zero - \use:c { fp_compare_absolute_a > b: } + \tex_ifnum:D \l_fp_input_b_sign_int > \c_zero + \group_end: + \prg_return_false: \tex_else:D - \use:c { fp_compare_absolute_a < b: } + \group_end: + \prg_return_true: \tex_fi:D - \tex_fi:D + \tex_fi:D + \tex_else:D + \tex_ifnum:D \etex_numexpr:D + \l_fp_input_b_integer_int + \l_fp_input_b_decimal_int + = \c_zero + \tex_ifnum:D \l_fp_input_a_sign_int > \c_zero + \group_end: + \prg_return_true: + \tex_else:D + \group_end: + \prg_return_false: + \tex_fi:D + \tex_else:D + \use:c { fp_compare_>_aux: } + \tex_fi:D \tex_fi:D } -\cs_new_protected_nopar:cpn { fp_compare_<: } { - \tex_ifnum:D \l_fp_input_b_sign_int > \l_fp_input_a_sign_int +% \end{macrocode} +% Next, check the sign of the input: this again may give an obvious +% result. If both signs are the same, then hand off to comparing the +% absolute values. +% \begin{macrocode} +\cs_new_protected_nopar:cpn { fp_compare_>_aux: } { + \tex_ifnum:D \l_fp_input_a_sign_int > \l_fp_input_b_sign_int \group_end: \prg_return_true: \tex_else:D - \tex_ifnum:D \l_fp_input_b_sign_int < \l_fp_input_a_sign_int + \tex_ifnum:D \l_fp_input_a_sign_int < \l_fp_input_b_sign_int \group_end: \prg_return_false: \tex_else:D - \tex_ifnum:D \l_fp_input_b_sign_int > \c_zero - \use:c { fp_compare_absolute_a < b: } + \tex_ifnum:D \l_fp_input_a_sign_int > \c_zero + \use:c { fp_compare_absolute_a>b: } \tex_else:D - \use:c { fp_compare_absolute_a > b: } + \use:c { fp_compare_absolute_a b: } { +% \end{macrocode} +% Rather long runs of checks, as there is the need to go through each +% layer of the input and do the comparison. There is also the need to +% avoid messing up with equal inputs at each stage. +% \begin{macrocode} +\cs_new_protected_nopar:cpn { fp_compare_absolute_a>b: } { \tex_ifnum:D \l_fp_input_a_exponent_int > \l_fp_input_b_exponent_int \group_end: \prg_return_true: \tex_else:D \tex_ifnum:D \l_fp_input_a_exponent_int < \l_fp_input_b_exponent_int - \tex_ifnum:D - \etex_numexpr:D - \l_fp_input_b_integer_int + \l_fp_input_b_decimal_int - = \c_zero - \group_end: - \prg_return_true: - \tex_else:D - \group_end: - \prg_return_false: - \tex_fi:D + \group_end: + \prg_return_false: \tex_else:D \tex_ifnum:D \l_fp_input_a_integer_int > \l_fp_input_b_integer_int \group_end: @@ -3930,18 +3949,10 @@ \tex_fi:D \tex_fi:D } -\cs_new_protected_nopar:cpn { fp_compare_absolute_a < b: } { +\cs_new_protected_nopar:cpn { fp_compare_absolute_a \l_fp_input_a_exponent_int - \tex_ifnum:D - \etex_numexpr:D - \l_fp_input_b_integer_int + \l_fp_input_b_decimal_int - = \c_zero - \group_end: - \prg_return_false: - \tex_else:D - \group_end: - \prg_return_true: - \tex_fi:D + \group_end: + \prg_return_true: \tex_else:D \tex_ifnum:D \l_fp_input_b_exponent_int < \l_fp_input_a_exponent_int \group_end: @@ -3969,8 +3980,35 @@ \tex_fi:D \tex_fi:D } - % \end{macrocode} +% This is just a case of reversing the two input values and then +% running the tests already defined. +% \begin{macrocode} +\cs_new_protected_nopar:cpn { fp_compare_<: } { + \tl_set:Nx \l_fp_tmp_tl + { + \int_set:Nn \exp_not:N \l_fp_input_a_sign_int + { \int_use:N \l_fp_input_b_sign_int } + \int_set:Nn \exp_not:N \l_fp_input_a_integer_int + { \int_use:N \l_fp_input_b_integer_int } + \int_set:Nn \exp_not:N \l_fp_input_a_decimal_int + { \int_use:N \l_fp_input_b_decimal_int } + \int_set:Nn \exp_not:N \l_fp_input_a_exponent_int + { \int_use:N \l_fp_input_b_exponent_int } + \int_set:Nn \exp_not:N \l_fp_input_b_sign_int + { \int_use:N \l_fp_input_a_sign_int } + \int_set:Nn \exp_not:N \l_fp_input_b_integer_int + { \int_use:N \l_fp_input_a_integer_int } + \int_set:Nn \exp_not:N \l_fp_input_b_decimal_int + { \int_use:N \l_fp_input_a_decimal_int } + \int_set:Nn \exp_not:N \l_fp_input_b_exponent_int + { \int_use:N \l_fp_input_a_exponent_int } + } + \l_fp_tmp_tl + \use:c { fp_compare_>: } +} +% \end{macrocode} +%\end{macro} %\end{macro} %\end{macro} %\end{macro} diff --git a/Master/texmf-dist/source/latex/expl3/l3int.dtx b/Master/texmf-dist/source/latex/expl3/l3int.dtx index f29c018f1e1..b71bffea94b 100644 --- a/Master/texmf-dist/source/latex/expl3/l3int.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3int.dtx @@ -36,7 +36,7 @@ \RequirePackage{l3names} % %\fi -\GetIdInfo$Id: l3int.dtx 2070 2010-10-09 06:55:11Z joseph $ +\GetIdInfo$Id: l3int.dtx 2077 2010-10-17 07:47:48Z will $ {L3 Experimental Integer module} %\iffalse %<*driver> @@ -2400,6 +2400,11 @@ \cs_set_eq:NN \intexpr_if_odd:nT \int_if_odd:nT \cs_set_eq:NN \intexpr_if_odd:nF \int_if_odd:nF +\cs_set_eq:NN \intexpr_if_even_p:n \int_if_even_p:n +\cs_set_eq:NN \intexpr_if_even:nTF \int_if_even:nTF +\cs_set_eq:NN \intexpr_if_even:nT \int_if_even:nT +\cs_set_eq:NN \intexpr_if_even:nF \int_if_even:nF + \cs_set_eq:NN \intexpr_while_do:nn \int_while_do:nn \cs_set_eq:NN \intexpr_until_do:nn \int_until_do:nn \cs_set_eq:NN \intexpr_do_while:nn \int_do_while:nn diff --git a/Master/texmf-dist/source/latex/expl3/l3keys.dtx b/Master/texmf-dist/source/latex/expl3/l3keys.dtx index ffe0b56fce4..8bab244c997 100644 --- a/Master/texmf-dist/source/latex/expl3/l3keys.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3keys.dtx @@ -35,7 +35,7 @@ \RequirePackage{l3names} % %\fi -\GetIdInfo$Id: l3keys.dtx 2075 2010-10-13 19:06:55Z joseph $ +\GetIdInfo$Id: l3keys.dtx 2079 2010-10-27 07:08:41Z joseph $ {L3 Experimental key-value support} %\iffalse %<*driver> @@ -274,6 +274,22 @@ % variable does not exist, it will be created at the point that the % key is set up. %\end{function} +% +%\begin{function}{ +% .fp_set:N | +% .fp_set:c | +% .fp_gset:N | +% .fp_gset:c | +%} +% \begin{syntax} +% .fp_set:N = +% \end{syntax} +% Sets to store the value it is given in . Here, +% is a \LaTeX3 \texttt{fp} variable +% (\emph{i.e}.~created using \cs{fp_new:N}). If the +% variable does not exist, it will be created at the point that the +% key is set up. +%\end{function} % %\begin{function}{.generate_choices:n} % \begin{syntax} @@ -1402,6 +1418,30 @@ %\end{macro} %\end{macro} % +%\begin{macro}{.fp_set:N} +%\begin{macro}{.fp_set:c} +%\begin{macro}{.fp_gset:N} +%\begin{macro}{.fp_gset:c} +% Setting a variable is very easy: just pass the data along. +% \begin{macrocode} +\keys_property_new_arg:nn { .fp_set:N } { + \keys_variable_set:NnNN #1 { fp } { } n +} +\keys_property_new_arg:nn { .fp_set:c } { + \keys_variable_set:cnNN {#1} { fp } { } n +} +\keys_property_new_arg:nn { .fp_gset:N } { + \keys_variable_set:NnNN #1 { fp } g n +} +\keys_property_new_arg:nn { .fp_gset:c } { + \keys_variable_set:cnNN {#1} { fp } g n +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +% %\begin{macro}{.generate_choices:n} % Making choices is easy. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/expl3/l3tl.dtx b/Master/texmf-dist/source/latex/expl3/l3tl.dtx index 585d50eb9bc..a717c11c23c 100644 --- a/Master/texmf-dist/source/latex/expl3/l3tl.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3tl.dtx @@ -36,7 +36,7 @@ \RequirePackage{l3names} % %\fi -\GetIdInfo$Id: l3tl.dtx 2063 2010-10-03 08:26:49Z mittelba $ +\GetIdInfo$Id: l3tl.dtx 2081 2010-10-29 07:47:38Z joseph $ {L3 Experimental Token Lists} %\iffalse %<*driver> @@ -705,8 +705,10 @@ % \begin{function}{% % \tl_head:n / (EXP) | % \tl_head:V / (EXP) | +% \tl_head:v / (EXP) | % \tl_tail:n / (EXP) | % \tl_tail:V / (EXP) | +% \tl_tail:v / (EXP) | % \tl_tail:f / (EXP) | % \tl_head_i:n / (EXP) | % \tl_head_iii:n / (EXP) | @@ -1085,34 +1087,34 @@ % hand tuned functions for performance reasons. % \begin{macrocode} \cs_new_protected:Npn \tl_put_right:Nn #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:n {#2} } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:n {#2} } } \cs_new_protected:Npn \tl_put_right:NV #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:V #2 } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:V #2 } } \cs_new_protected:Npn \tl_put_right:Nv #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:v {#2} } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:v {#2} } } \cs_new_protected:Npn \tl_put_right:Nx #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:V #1 #2 } + \cs_set_nopar:Npx #1 { \exp_not:o #1 #2 } } \cs_new_protected:Npn \tl_put_right:No #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:o {#2} } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:o {#2} } } \cs_new_protected:Npn \tl_gput_right:Nn #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:V #1 \exp_not:n {#2} } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:n {#2} } } \cs_new_protected:Npn \tl_gput_right:NV #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:V #1 \exp_not:V #2 } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:V #2 } } \cs_new_protected:Npn \tl_gput_right:Nv #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:V #1 \exp_not:v {#2} } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:v {#2} } } \cs_new_protected:Npn \tl_gput_right:No #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:V #1 \exp_not:o {#2} } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:o {#2} } } \cs_new_protected:Npn \tl_gput_right:Nx #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:V #1 #2 } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 #2 } } \cs_generate_variant:Nn \tl_put_right:Nn { c } \cs_generate_variant:Nn \tl_put_right:NV { c } @@ -1165,34 +1167,34 @@ % Adding to the left is basically the same as putting on the right. % \begin{macrocode} \cs_new_protected:Npn \tl_put_left:Nn #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:n {#2} \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:n {#2} \exp_not:o #1 } } \cs_new_protected:Npn \tl_put_left:NV #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:V #2 \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:V #2 \exp_not:o #1 } } \cs_new_protected:Npn \tl_put_left:Nv #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:v {#2} \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:v {#2} \exp_not:o #1 } } \cs_new_protected:Npn \tl_put_left:Nx #1#2 { - \cs_set_nopar:Npx #1 { #2 \exp_not:V #1 } + \cs_set_nopar:Npx #1 { #2 \exp_not:o #1 } } \cs_new_protected:Npn \tl_put_left:No #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:o {#2} \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:o {#2} \exp_not:o #1 } } \cs_new_protected:Npn \tl_gput_left:Nn #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:n {#2} \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { \exp_not:n {#2} \exp_not:o #1 } } \cs_new_protected:Npn \tl_gput_left:NV #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:V #2 \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { \exp_not:V #2 \exp_not:o #1 } } \cs_new_protected:Npn \tl_gput_left:Nv #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:v {#2} \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { \exp_not:v {#2} \exp_not:o #1 } } \cs_new_protected:Npn \tl_gput_left:No #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:o {#2} \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { \exp_not:o {#2} \exp_not:o #1 } } \cs_new_protected:Npn \tl_gput_left:Nx #1#2 { - \cs_gset_nopar:Npx #1 { #2 \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { #2 \exp_not:o #1 } } \cs_generate_variant:Nn \tl_put_left:Nn { c } \cs_generate_variant:Nn \tl_put_left:NV { c } @@ -2014,9 +2016,11 @@ % % \begin{macro}{\tl_head:n} % \begin{macro}{\tl_head:V} +% \begin{macro}{\tl_head:v} % \begin{macro}{\tl_head_i:n} % \begin{macro}{\tl_tail:n} % \begin{macro}{\tl_tail:V} +% \begin{macro}{\tl_tail:v} % \begin{macro}{\tl_tail:f} % \begin{macro}{\tl_head_iii:n} % \begin{macro}{\tl_head_iii:f} @@ -2038,7 +2042,9 @@ \cs_new:Npn \tl_tail:w #1#2\q_stop{#2} \cs_new:Npn \tl_head_iii:w #1#2#3#4\q_stop{#1#2#3} \cs_generate_variant:Nn \tl_head:n { V } +\cs_generate_variant:Nn \tl_head:n { v } \cs_generate_variant:Nn \tl_tail:n { V } +\cs_generate_variant:Nn \tl_tail:n { v } % \end{macrocode} % \end{macro} % \end{macro} @@ -2052,6 +2058,8 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} +% \end{macro} % % \begin{macro}{\tl_if_head_eq_meaning_p:nN} % \begin{macro}[TF]{\tl_if_head_eq_meaning:nN} @@ -2171,75 +2179,75 @@ } \cs_set_protected:Npn \tl_put_right:Nn #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:n {#2} } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:n {#2} } } \cs_set_protected:Npn \tl_put_right:NV #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:V #2 } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:V #2 } } \cs_set_protected:Npn \tl_put_right:Nv #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:v {#2} } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:v {#2} } } \cs_set_protected:Npn \tl_put_right:No #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:o {#2} } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:o {#2} } } \cs_set_protected:Npn \tl_put_right:Nx #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:V #1 #2 } + \cs_set_nopar:Npx #1 { \exp_not:o #1 #2 } } \cs_set_protected:Npn \tl_gput_right:Nn #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:V #1 \exp_not:n {#2} } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:n {#2} } } \cs_set_protected:Npn \tl_gput_right:NV #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:V #1 \exp_not:V #2 } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:V #2 } } \cs_set_protected:Npn \tl_gput_right:Nv #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:V #1 \exp_not:v {#2} } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:v {#2} } } \cs_set_protected:Npn \tl_gput_right:Nx #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:V #1 #2 } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 #2 } } \cs_set_protected:Npn \tl_put_left:Nn #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:n {#2} \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:n {#2} \exp_not:o #1 } } \cs_set_protected:Npn \tl_put_left:NV #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:V #2 \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:V #2 \exp_not:o #1 } } \cs_set_protected:Npn \tl_put_left:Nv #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:v {#2} \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:v {#2} \exp_not:o #1 } } \cs_set_protected:Npn \tl_put_left:No #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:o {#2} \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:o {#2} \exp_not:o #1 } } \cs_set_protected:Npn \tl_put_left:Nx #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { #2 \exp_not:V #1 } + \cs_set_nopar:Npx #1 { #2 \exp_not:o #1 } } \cs_set_protected:Npn \tl_gput_left:Nn #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:n {#2} \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { \exp_not:n {#2} \exp_not:o #1 } } \cs_set_protected:Npn \tl_gput_left:NV #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:V #2 \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { \exp_not:V #2 \exp_not:o #1 } } \cs_set_protected:Npn \tl_gput_left:Nv #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:v {#2} \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { \exp_not:v {#2} \exp_not:o #1 } } \cs_set_protected:Npn \tl_gput_left:Nx #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { #2 \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { #2 \exp_not:o #1 } } \tex_fi:D % diff --git a/Master/texmf-dist/tex/latex/expl3/l3fp.sty b/Master/texmf-dist/tex/latex/expl3/l3fp.sty index a94e6c3763e..55b088bfbde 100644 --- a/Master/texmf-dist/tex/latex/expl3/l3fp.sty +++ b/Master/texmf-dist/tex/latex/expl3/l3fp.sty @@ -48,7 +48,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3fp.dtx 2029 2010-09-19 13:59:02Z joseph $ +\GetIdInfo$Id: l3fp.dtx 2080 2010-10-27 11:02:09Z joseph $ {L3 Experimental floating-point operations} \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} @@ -2124,55 +2124,64 @@ \tex_fi:D } \cs_new_protected_nopar:cpn { fp_compare_>: } { - \tex_ifnum:D \l_fp_input_a_sign_int > \l_fp_input_b_sign_int - \group_end: - \prg_return_true: - \tex_else:D - \tex_ifnum:D \l_fp_input_a_sign_int < \l_fp_input_b_sign_int + \tex_ifnum:D \etex_numexpr:D + \l_fp_input_a_integer_int + \l_fp_input_a_decimal_int + = \c_zero + \tex_ifnum:D \etex_numexpr:D + \l_fp_input_b_integer_int + \l_fp_input_b_decimal_int + = \c_zero \group_end: \prg_return_false: \tex_else:D + \tex_ifnum:D \l_fp_input_b_sign_int > \c_zero + \group_end: + \prg_return_false: + \tex_else:D + \group_end: + \prg_return_true: + \tex_fi:D + \tex_fi:D + \tex_else:D + \tex_ifnum:D \etex_numexpr:D + \l_fp_input_b_integer_int + \l_fp_input_b_decimal_int + = \c_zero \tex_ifnum:D \l_fp_input_a_sign_int > \c_zero - \use:c { fp_compare_absolute_a > b: } + \group_end: + \prg_return_true: \tex_else:D - \use:c { fp_compare_absolute_a < b: } + \group_end: + \prg_return_false: \tex_fi:D + \tex_else:D + \use:c { fp_compare_>_aux: } \tex_fi:D \tex_fi:D } -\cs_new_protected_nopar:cpn { fp_compare_<: } { - \tex_ifnum:D \l_fp_input_b_sign_int > \l_fp_input_a_sign_int +\cs_new_protected_nopar:cpn { fp_compare_>_aux: } { + \tex_ifnum:D \l_fp_input_a_sign_int > \l_fp_input_b_sign_int \group_end: \prg_return_true: \tex_else:D - \tex_ifnum:D \l_fp_input_b_sign_int < \l_fp_input_a_sign_int + \tex_ifnum:D \l_fp_input_a_sign_int < \l_fp_input_b_sign_int \group_end: \prg_return_false: \tex_else:D - \tex_ifnum:D \l_fp_input_b_sign_int > \c_zero - \use:c { fp_compare_absolute_a < b: } + \tex_ifnum:D \l_fp_input_a_sign_int > \c_zero + \use:c { fp_compare_absolute_a>b: } \tex_else:D - \use:c { fp_compare_absolute_a > b: } + \use:c { fp_compare_absolute_a b: } { +\cs_new_protected_nopar:cpn { fp_compare_absolute_a>b: } { \tex_ifnum:D \l_fp_input_a_exponent_int > \l_fp_input_b_exponent_int \group_end: \prg_return_true: \tex_else:D \tex_ifnum:D \l_fp_input_a_exponent_int < \l_fp_input_b_exponent_int - \tex_ifnum:D - \etex_numexpr:D - \l_fp_input_b_integer_int + \l_fp_input_b_decimal_int - = \c_zero - \group_end: - \prg_return_true: - \tex_else:D - \group_end: - \prg_return_false: - \tex_fi:D + \group_end: + \prg_return_false: \tex_else:D \tex_ifnum:D \l_fp_input_a_integer_int > \l_fp_input_b_integer_int \group_end: @@ -2196,18 +2205,10 @@ \tex_fi:D \tex_fi:D } -\cs_new_protected_nopar:cpn { fp_compare_absolute_a < b: } { +\cs_new_protected_nopar:cpn { fp_compare_absolute_a \l_fp_input_a_exponent_int - \tex_ifnum:D - \etex_numexpr:D - \l_fp_input_b_integer_int + \l_fp_input_b_decimal_int - = \c_zero - \group_end: - \prg_return_false: - \tex_else:D - \group_end: - \prg_return_true: - \tex_fi:D + \group_end: + \prg_return_true: \tex_else:D \tex_ifnum:D \l_fp_input_b_exponent_int < \l_fp_input_a_exponent_int \group_end: @@ -2235,7 +2236,29 @@ \tex_fi:D \tex_fi:D } - +\cs_new_protected_nopar:cpn { fp_compare_<: } { + \tl_set:Nx \l_fp_tmp_tl + { + \int_set:Nn \exp_not:N \l_fp_input_a_sign_int + { \int_use:N \l_fp_input_b_sign_int } + \int_set:Nn \exp_not:N \l_fp_input_a_integer_int + { \int_use:N \l_fp_input_b_integer_int } + \int_set:Nn \exp_not:N \l_fp_input_a_decimal_int + { \int_use:N \l_fp_input_b_decimal_int } + \int_set:Nn \exp_not:N \l_fp_input_a_exponent_int + { \int_use:N \l_fp_input_b_exponent_int } + \int_set:Nn \exp_not:N \l_fp_input_b_sign_int + { \int_use:N \l_fp_input_a_sign_int } + \int_set:Nn \exp_not:N \l_fp_input_b_integer_int + { \int_use:N \l_fp_input_a_integer_int } + \int_set:Nn \exp_not:N \l_fp_input_b_decimal_int + { \int_use:N \l_fp_input_a_decimal_int } + \int_set:Nn \exp_not:N \l_fp_input_b_exponent_int + { \int_use:N \l_fp_input_a_exponent_int } + } + \l_fp_tmp_tl + \use:c { fp_compare_>: } +} \msg_kernel_new:nnnn { fpu } { overflow } { Number~too~big. } { diff --git a/Master/texmf-dist/tex/latex/expl3/l3int.sty b/Master/texmf-dist/tex/latex/expl3/l3int.sty index 230ff5aed01..c8f4b0836e2 100644 --- a/Master/texmf-dist/tex/latex/expl3/l3int.sty +++ b/Master/texmf-dist/tex/latex/expl3/l3int.sty @@ -48,7 +48,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3int.dtx 2070 2010-10-09 06:55:11Z joseph $ +\GetIdInfo$Id: l3int.dtx 2077 2010-10-17 07:47:48Z will $ {L3 Experimental Integer module} \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} @@ -751,6 +751,11 @@ \cs_set_eq:NN \intexpr_if_odd:nT \int_if_odd:nT \cs_set_eq:NN \intexpr_if_odd:nF \int_if_odd:nF +\cs_set_eq:NN \intexpr_if_even_p:n \int_if_even_p:n +\cs_set_eq:NN \intexpr_if_even:nTF \int_if_even:nTF +\cs_set_eq:NN \intexpr_if_even:nT \int_if_even:nT +\cs_set_eq:NN \intexpr_if_even:nF \int_if_even:nF + \cs_set_eq:NN \intexpr_while_do:nn \int_while_do:nn \cs_set_eq:NN \intexpr_until_do:nn \int_until_do:nn \cs_set_eq:NN \intexpr_do_while:nn \int_do_while:nn diff --git a/Master/texmf-dist/tex/latex/expl3/l3keys.sty b/Master/texmf-dist/tex/latex/expl3/l3keys.sty index 694c7ce4cd7..4cca72a9976 100644 --- a/Master/texmf-dist/tex/latex/expl3/l3keys.sty +++ b/Master/texmf-dist/tex/latex/expl3/l3keys.sty @@ -48,7 +48,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3keys.dtx 2075 2010-10-13 19:06:55Z joseph $ +\GetIdInfo$Id: l3keys.dtx 2079 2010-10-27 07:08:41Z joseph $ {L3 Experimental key-value support} \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} @@ -362,6 +362,18 @@ \keys_property_new_arg:nn { .dim_gset:c } { \keys_variable_set:cnNN {#1} { dim } g n } +\keys_property_new_arg:nn { .fp_set:N } { + \keys_variable_set:NnNN #1 { fp } { } n +} +\keys_property_new_arg:nn { .fp_set:c } { + \keys_variable_set:cnNN {#1} { fp } { } n +} +\keys_property_new_arg:nn { .fp_gset:N } { + \keys_variable_set:NnNN #1 { fp } g n +} +\keys_property_new_arg:nn { .fp_gset:c } { + \keys_variable_set:cnNN {#1} { fp } g n +} \keys_property_new_arg:nn { .generate_choices:n } { \keys_choices_generate:n {#1} } diff --git a/Master/texmf-dist/tex/latex/expl3/l3tl.sty b/Master/texmf-dist/tex/latex/expl3/l3tl.sty index 2fd347e0184..68c13a3aeab 100644 --- a/Master/texmf-dist/tex/latex/expl3/l3tl.sty +++ b/Master/texmf-dist/tex/latex/expl3/l3tl.sty @@ -48,7 +48,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3tl.dtx 2063 2010-10-03 08:26:49Z mittelba $ +\GetIdInfo$Id: l3tl.dtx 2081 2010-10-29 07:47:38Z joseph $ {L3 Experimental Token Lists} \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} @@ -122,34 +122,34 @@ \cs_new_eq:NN \tl_gclear_new:N \tl_gclear:N \cs_generate_variant:Nn \tl_gclear_new:N {c} \cs_new_protected:Npn \tl_put_right:Nn #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:n {#2} } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:n {#2} } } \cs_new_protected:Npn \tl_put_right:NV #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:V #2 } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:V #2 } } \cs_new_protected:Npn \tl_put_right:Nv #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:v {#2} } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:v {#2} } } \cs_new_protected:Npn \tl_put_right:Nx #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:V #1 #2 } + \cs_set_nopar:Npx #1 { \exp_not:o #1 #2 } } \cs_new_protected:Npn \tl_put_right:No #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:o {#2} } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:o {#2} } } \cs_new_protected:Npn \tl_gput_right:Nn #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:V #1 \exp_not:n {#2} } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:n {#2} } } \cs_new_protected:Npn \tl_gput_right:NV #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:V #1 \exp_not:V #2 } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:V #2 } } \cs_new_protected:Npn \tl_gput_right:Nv #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:V #1 \exp_not:v {#2} } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:v {#2} } } \cs_new_protected:Npn \tl_gput_right:No #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:V #1 \exp_not:o {#2} } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:o {#2} } } \cs_new_protected:Npn \tl_gput_right:Nx #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:V #1 #2 } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 #2 } } \cs_generate_variant:Nn \tl_put_right:Nn { c } \cs_generate_variant:Nn \tl_put_right:NV { c } @@ -161,34 +161,34 @@ \cs_generate_variant:Nn \tl_gput_right:No { c } \cs_generate_variant:Nn \tl_gput_right:Nx { c } \cs_new_protected:Npn \tl_put_left:Nn #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:n {#2} \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:n {#2} \exp_not:o #1 } } \cs_new_protected:Npn \tl_put_left:NV #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:V #2 \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:V #2 \exp_not:o #1 } } \cs_new_protected:Npn \tl_put_left:Nv #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:v {#2} \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:v {#2} \exp_not:o #1 } } \cs_new_protected:Npn \tl_put_left:Nx #1#2 { - \cs_set_nopar:Npx #1 { #2 \exp_not:V #1 } + \cs_set_nopar:Npx #1 { #2 \exp_not:o #1 } } \cs_new_protected:Npn \tl_put_left:No #1#2 { - \cs_set_nopar:Npx #1 { \exp_not:o {#2} \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:o {#2} \exp_not:o #1 } } \cs_new_protected:Npn \tl_gput_left:Nn #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:n {#2} \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { \exp_not:n {#2} \exp_not:o #1 } } \cs_new_protected:Npn \tl_gput_left:NV #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:V #2 \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { \exp_not:V #2 \exp_not:o #1 } } \cs_new_protected:Npn \tl_gput_left:Nv #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:v {#2} \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { \exp_not:v {#2} \exp_not:o #1 } } \cs_new_protected:Npn \tl_gput_left:No #1#2 { - \cs_gset_nopar:Npx #1 { \exp_not:o {#2} \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { \exp_not:o {#2} \exp_not:o #1 } } \cs_new_protected:Npn \tl_gput_left:Nx #1#2 { - \cs_gset_nopar:Npx #1 { #2 \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { #2 \exp_not:o #1 } } \cs_generate_variant:Nn \tl_put_left:Nn { c } \cs_generate_variant:Nn \tl_put_left:NV { c } @@ -520,7 +520,9 @@ \cs_new:Npn \tl_tail:w #1#2\q_stop{#2} \cs_new:Npn \tl_head_iii:w #1#2#3#4\q_stop{#1#2#3} \cs_generate_variant:Nn \tl_head:n { V } +\cs_generate_variant:Nn \tl_head:n { v } \cs_generate_variant:Nn \tl_tail:n { V } +\cs_generate_variant:Nn \tl_tail:n { v } \prg_new_conditional:Npnn \tl_if_head_eq_meaning:nN #1#2 {p,TF,T,F} { \exp_after:wN \if_meaning:w \tl_head:w #1 \q_stop #2 \prg_return_true: \else: \prg_return_false: \fi: @@ -591,75 +593,75 @@ } \cs_set_protected:Npn \tl_put_right:Nn #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:n {#2} } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:n {#2} } } \cs_set_protected:Npn \tl_put_right:NV #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:V #2 } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:V #2 } } \cs_set_protected:Npn \tl_put_right:Nv #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:v {#2} } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:v {#2} } } \cs_set_protected:Npn \tl_put_right:No #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:V #1 \exp_not:o {#2} } + \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:o {#2} } } \cs_set_protected:Npn \tl_put_right:Nx #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:V #1 #2 } + \cs_set_nopar:Npx #1 { \exp_not:o #1 #2 } } \cs_set_protected:Npn \tl_gput_right:Nn #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:V #1 \exp_not:n {#2} } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:n {#2} } } \cs_set_protected:Npn \tl_gput_right:NV #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:V #1 \exp_not:V #2 } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:V #2 } } \cs_set_protected:Npn \tl_gput_right:Nv #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:V #1 \exp_not:v {#2} } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:v {#2} } } \cs_set_protected:Npn \tl_gput_right:Nx #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:V #1 #2 } + \cs_gset_nopar:Npx #1 { \exp_not:o #1 #2 } } \cs_set_protected:Npn \tl_put_left:Nn #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:n {#2} \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:n {#2} \exp_not:o #1 } } \cs_set_protected:Npn \tl_put_left:NV #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:V #2 \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:V #2 \exp_not:o #1 } } \cs_set_protected:Npn \tl_put_left:Nv #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:v {#2} \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:v {#2} \exp_not:o #1 } } \cs_set_protected:Npn \tl_put_left:No #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:o {#2} \exp_not:V #1 } + \cs_set_nopar:Npx #1 { \exp_not:o {#2} \exp_not:o #1 } } \cs_set_protected:Npn \tl_put_left:Nx #1#2 { \_tl_check_exists:N #1 - \cs_set_nopar:Npx #1 { #2 \exp_not:V #1 } + \cs_set_nopar:Npx #1 { #2 \exp_not:o #1 } } \cs_set_protected:Npn \tl_gput_left:Nn #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:n {#2} \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { \exp_not:n {#2} \exp_not:o #1 } } \cs_set_protected:Npn \tl_gput_left:NV #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:V #2 \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { \exp_not:V #2 \exp_not:o #1 } } \cs_set_protected:Npn \tl_gput_left:Nv #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:v {#2} \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { \exp_not:v {#2} \exp_not:o #1 } } \cs_set_protected:Npn \tl_gput_left:Nx #1#2 { \_tl_check_exists:N #1 - \cs_gset_nopar:Npx #1 { #2 \exp_not:V #1 } + \cs_gset_nopar:Npx #1 { #2 \exp_not:o #1 } } \tex_fi:D %% -- cgit v1.2.3