diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/expl3/l3fp.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/expl3/l3fp.sty | 97 |
1 files changed, 60 insertions, 37 deletions
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: } \tex_fi:D \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>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<b: } { \tex_ifnum:D \l_fp_input_b_exponent_int > \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. } { |