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/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 ++++++++++++----------- 4 files changed, 120 insertions(+), 78 deletions(-) (limited to 'Master/texmf-dist/tex/latex') 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