diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3fp.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3fp.sty | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty b/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty index 4754b592c0c..ec67d73f5d5 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty @@ -286,8 +286,8 @@ \__fp_tmp:w {xv} {\use_none:n #2#3+#4#5} { 000{0000}0000{0000}#2 #3 #4 #5 } \__fp_tmp:w {xvi} { #2#3+#4#5} {{0000}0000{0000}0000 #2 #3 #4 #5 } \cs_new:Npn \__fp_decimate_pack:nnnnnnnnnnw #1#2#3#4#5 - { \__fp_decimate_pack_ii:nnnnnnw { #1#2#3#4#5 } } -\cs_new:Npn \__fp_decimate_pack_ii:nnnnnnw #1 #2#3#4#5#6 + { \__fp_decimate_pack:nnnnnnw { #1#2#3#4#5 } } +\cs_new:Npn \__fp_decimate_pack:nnnnnnw #1 #2#3#4#5#6 { {#1} {#2#3#4#5#6} } \cs_new:Npn \__fp_case_use:nw #1#2 \fi: #3 \s__fp { \fi: #1 \s__fp } \cs_new:Npn \__fp_case_return:nw #1#2 \fi: #3 ; { \fi: #1 } @@ -715,11 +715,11 @@ \cs_new:Npn \__fp_round_normal:NwNNnw #1#2 \s__fp \__fp_chk:w 1#3#4#5; { \__fp_decimate:nNnnnn { \c_sixteen - #4 - #2 } - \__fp_round_normal_ii:NnnwNNnn #5 #1 #3 {#4} {#2} + \__fp_round_normal:NnnwNNnn #5 #1 #3 {#4} {#2} } -\cs_new:Npn \__fp_round_normal_ii:NnnwNNnn #1#2#3#4; #5#6 +\cs_new:Npn \__fp_round_normal:NnnwNNnn #1#2#3#4; #5#6 { - \exp_after:wN \__fp_round_normal_iii:NNwNnn + \exp_after:wN \__fp_round_normal:NNwNnn \int_use:N \__int_eval:w \if_int_compare:w #2 > \c_zero 1 \__int_value:w #2 @@ -739,7 +739,7 @@ } \cs_new:Npn \__fp_round_pack:Nw #1 { \if_meaning:w 2 #1 + \c_one \fi: \__int_eval_end: } -\cs_new:Npn \__fp_round_normal_iii:NNwNnn #1 #2 +\cs_new:Npn \__fp_round_normal:NNwNnn #1 #2 { \if_meaning:w 0 #2 \exp_after:wN \__fp_round_special:NwwNnn @@ -1174,14 +1174,14 @@ \cs_new:Npn \__fp_parse_exponent:N #1 { \if:w e #1 - \exp_after:wN \__fp_parse_exponent_ii:N + \exp_after:wN \__fp_parse_exponent_aux:N \tex_romannumeral:D \else: 0 \__fp_parse_return_semicolon:w #1 \fi: \__fp_parse_expand:w } -\cs_new:Npn \__fp_parse_exponent_ii:N #1 +\cs_new:Npn \__fp_parse_exponent_aux:N #1 { \if_int_compare:w \if_catcode:w \tex_relax:D #1 \c_zero \else: `#1 \fi: > `9 \exp_stop_f: @@ -1321,7 +1321,7 @@ \cs_new:Npn \__fp_parse_large_round_after:wNN #1 ; #2 #3 { \if:w . #3 - \exp_after:wN \__fp_parse_large_round_after_ii:wN + \exp_after:wN \__fp_parse_large_round_after_aux:wN \int_use:N \__int_eval:w #1 + \c_zero * \__int_eval:w \c_zero \exp_after:wN \__fp_cfs_round_loop:N @@ -1334,7 +1334,7 @@ \exp_after:wN #3 \fi: } -\cs_new:Npn \__fp_parse_large_round_after_ii:wN #1 ; #2 +\cs_new:Npn \__fp_parse_large_round_after_aux:wN #1 ; #2 { + #2 \exp_after:wN ; @@ -1809,7 +1809,7 @@ \__msg_kernel_expandable_error:nnnn { kernel } { fp-missing } { ? } { ~for~?: } \exp_after:wN @ - \exp_after:wN \__fp_ternary_ii:NwwN + \exp_after:wN \__fp_ternary_auxii:NwwN \tex_romannumeral:D \__fp_parse_until:Nw \c_two \exp_after:wN \__fp_parse_expand:w @@ -2079,9 +2079,9 @@ { \if_meaning:w 3 #4 \if_meaning:w 3 #2 - \__fp_minmax_i:ww + \__fp_minmax_auxi:ww \else: - \__fp_minmax_ii:ww + \__fp_minmax_auxii:ww \fi: \else: \if_int_compare:w @@ -2089,18 +2089,18 @@ \s__fp \__fp_chk:w #4#5; \s__fp \__fp_chk:w #2#3; = #1 - \__fp_minmax_ii:ww + \__fp_minmax_auxii:ww \else: - \__fp_minmax_i:ww + \__fp_minmax_auxi:ww \fi: \fi: \__fp_minmax_loop:Nww #1 \s__fp \__fp_chk:w #2#3; \s__fp \__fp_chk:w #4#5; } -\cs_new:Npn \__fp_minmax_i:ww #1 \fi: \fi: #2 \s__fp #3 ; \s__fp #4; +\cs_new:Npn \__fp_minmax_auxi:ww #1 \fi: \fi: #2 \s__fp #3 ; \s__fp #4; { \fi: \fi: #2 \s__fp #3 ; } -\cs_new:Npn \__fp_minmax_ii:ww #1 \fi: \fi: #2 \s__fp #3 ; +\cs_new:Npn \__fp_minmax_auxii:ww #1 \fi: \fi: #2 \s__fp #3 ; { \fi: \fi: #2 } \cs_new:Npn \__fp_minmax_break_o:w #1 \fi: \fi: #2 \s__fp #3; #4; { \fi: \__fp_exp_after_o:w \s__fp #3; } @@ -2131,7 +2131,7 @@ \__fp_ternary_loop:Nw #2 \s__fp \__fp_chk:w { \__fp_ternary_loop_break:w } ; - \__fp_ternary_break_point:n { \exp_after:wN \__fp_ternary_i:NwwN } + \__fp_ternary_break_point:n { \exp_after:wN \__fp_ternary_auxi:NwwN } \exp_after:wN #1 \tex_romannumeral:D -`0 \__fp_exp_after_array_f:w #3 \s__fp_stop @@ -2153,7 +2153,7 @@ \cs_new:Npn \__fp_ternary_loop_break:w #1 \fi: #2 \__fp_ternary_break_point:n #3 { \c_zero = \c_zero \fi: - \exp_after:wN \__fp_ternary_ii:NwwN + \exp_after:wN \__fp_ternary_auxii:NwwN } \cs_new:Npn \__fp_ternary_loop:Nw \s__fp \__fp_chk:w #1#2; { @@ -2163,7 +2163,7 @@ \__fp_ternary_loop:Nw } \cs_new:Npn \__fp_ternary_map_break: #1 \__fp_ternary_break_point:n #2 {#2} -\cs_new:Npn \__fp_ternary_i:NwwN #1#2@#3@#4 +\cs_new:Npn \__fp_ternary_auxi:NwwN #1#2@#3@#4 { \exp_after:wN \__fp_parse_until_test:NwN \exp_after:wN #1 @@ -2171,7 +2171,7 @@ \__fp_exp_after_array_f:w #2 \s__fp_stop #4 #1 } -\cs_new:Npn \__fp_ternary_ii:NwwN #1#2@#3@#4 +\cs_new:Npn \__fp_ternary_auxii:NwwN #1#2@#3@#4 { \exp_after:wN \__fp_parse_until_test:NwN \exp_after:wN #1 @@ -2850,43 +2850,43 @@ \exp_after:wN \__fp_fixed_div_int_after:Nw \exp_after:wN #8 \int_use:N \__int_eval:w \c_minus_one - \__fp_fixed_div_int_i:wnN - #1; {#7} \__fp_fixed_div_int_ii:wnn - #2; {#7} \__fp_fixed_div_int_ii:wnn - #3; {#7} \__fp_fixed_div_int_ii:wnn - #4; {#7} \__fp_fixed_div_int_ii:wnn - #5; {#7} \__fp_fixed_div_int_ii:wnn - #6; {#7} \__fp_fixed_div_int_iii:wnn ; + \__fp_fixed_div_int:wnN + #1; {#7} \__fp_fixed_div_int_auxi:wnn + #2; {#7} \__fp_fixed_div_int_auxi:wnn + #3; {#7} \__fp_fixed_div_int_auxi:wnn + #4; {#7} \__fp_fixed_div_int_auxi:wnn + #5; {#7} \__fp_fixed_div_int_auxi:wnn + #6; {#7} \__fp_fixed_div_int_auxii:wnn ; } -\cs_new:Npn \__fp_fixed_div_int_i:wnN #1; #2 #3 +\cs_new:Npn \__fp_fixed_div_int:wnN #1; #2 #3 { \exp_after:wN #3 \int_use:N \__int_eval:w #1 / #2 - \c_one ; {#2} {#1} } -\cs_new:Npn \__fp_fixed_div_int_ii:wnn #1; #2 #3 +\cs_new:Npn \__fp_fixed_div_int_auxi:wnn #1; #2 #3 { + #1 \exp_after:wN \__fp_fixed_div_int_pack:Nw \int_use:N \__int_eval:w 9999 - \exp_after:wN \__fp_fixed_div_int_i:wnN + \exp_after:wN \__fp_fixed_div_int:wnN \int_use:N \__int_eval:w #3 - #1*#2 \__int_eval_end: } -\cs_new:Npn \__fp_fixed_div_int_iii:wnn #1; #2 #3 { + #1 + \c_two ; } +\cs_new:Npn \__fp_fixed_div_int_auxii:wnn #1; #2 #3 { + #1 + \c_two ; } \cs_new:Npn \__fp_fixed_div_int_pack:Nw #1 #2; { + #1; {#2} } \cs_new:Npn \__fp_fixed_div_int_after:Nw #1 #2; { #1 {#2} } -\cs_new_nopar:Npn \__fp_fixed_add:wwn { \__fp_fixed_add_i:Nnnnnwnn + } -\cs_new_nopar:Npn \__fp_fixed_sub:wwn { \__fp_fixed_add_i:Nnnnnwnn - } -\cs_new:Npn \__fp_fixed_add_i:Nnnnnwnn #1 #2#3#4#5 #6; #7#8 +\cs_new_nopar:Npn \__fp_fixed_add:wwn { \__fp_fixed_add:Nnnnnwnn + } +\cs_new_nopar:Npn \__fp_fixed_sub:wwn { \__fp_fixed_add:Nnnnnwnn - } +\cs_new:Npn \__fp_fixed_add:Nnnnnwnn #1 #2#3#4#5 #6; #7#8 { \exp_after:wN \__fp_fixed_add_after:NNNNNwn \int_use:N \__int_eval:w 9 9999 9998 + #2#3 #1 #7#8 \exp_after:wN \__fp_fixed_add_pack:NNNNNwn \int_use:N \__int_eval:w 1 9999 9998 + #4#5 - \__fp_fixed_add_ii:nnNnnnwn #6 #1 + \__fp_fixed_add:nnNnnnwn #6 #1 } -\cs_new:Npn \__fp_fixed_add_ii:nnNnnnwn #1#2 #3 #4#5 #6#7 ; #8 +\cs_new:Npn \__fp_fixed_add:nnNnnnwn #1#2 #3 #4#5 #6#7 ; #8 { #3 #4#5 \exp_after:wN \__fp_fixed_add_pack:NNNNNwn @@ -2916,9 +2916,9 @@ \int_use:N \__int_eval:w \c__fp_trailing_shift_int + #2*#9 + #3*#8 + #4*#7 + ( #3*#9 + #4*#8 - + \__fp_fixed_mul_i:nnnnnnnwn #5 {#6}{#7} {#1}{#2} + + \__fp_fixed_mul:nnnnnnnwn #5 {#6}{#7} {#1}{#2} } -\cs_new:Npn \__fp_fixed_mul_i:nnnnnnnwn #1#2 #3#4 #5#6 #7#8 ; #9 +\cs_new:Npn \__fp_fixed_mul:nnnnnnnwn #1#2 #3#4 #5#6 #7#8 ; #9 { #1*#4 + #2*#3 + #5*#8 + #6*#7 ) / \c_ten_thousand + #1*#3 + #5*#7 ; @@ -2930,7 +2930,7 @@ \int_use:N \__int_eval:w \c__fp_big_leading_shift_int \exp_after:wN \__fp_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c__fp_big_middle_shift_int + #3 #4 - \__fp_fixed_mul_add_i:Nwnnnwnnn + + \__fp_fixed_mul_add:Nwnnnwnnn + + #5 #6 ; #2 ; #1 ; #2 ; + + #7 #8 ; {#9} ; } @@ -2940,7 +2940,7 @@ \int_use:N \__int_eval:w \c__fp_big_leading_shift_int \exp_after:wN \__fp_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c__fp_big_middle_shift_int + #3 #4 - \__fp_fixed_mul_add_i:Nwnnnwnnn - + \__fp_fixed_mul_add:Nwnnnwnnn - + #5 #6 ; #2 ; #1 ; #2 ; - + #7 #8 ; {#9} ; } @@ -2950,11 +2950,11 @@ \int_use:N \__int_eval:w \c__fp_big_leading_shift_int \exp_after:wN \__fp_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c__fp_big_middle_shift_int + 1 0000 0000 - \__fp_fixed_mul_add_i:Nwnnnwnnn - + \__fp_fixed_mul_add:Nwnnnwnnn - ; #2 ; #1 ; #2 ; - ; {#3} ; } -\cs_new:Npn \__fp_fixed_mul_add_i:Nwnnnwnnn #1 #2; #3#4#5#6; #7#8#9 +\cs_new:Npn \__fp_fixed_mul_add:Nwnnnwnnn #1 #2; #3#4#5#6; #7#8#9 { #1 #7*#3 \exp_after:wN \__fp_pack_big:NNNNNNwn @@ -2965,20 +2965,20 @@ #1 #7*#5 #1 #8*#4 #1 #9*#3 #2 \exp_after:wN \__fp_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c__fp_big_middle_shift_int - #1 \__fp_fixed_mul_add_ii:nnnnwnnnn {#7}{#8}{#9} + #1 \__fp_fixed_mul_add:nnnnwnnnn {#7}{#8}{#9} } -\cs_new:Npn \__fp_fixed_mul_add_ii:nnnnwnnnn #1#2#3#4#5; #6#7#8#9 +\cs_new:Npn \__fp_fixed_mul_add:nnnnwnnnn #1#2#3#4#5; #6#7#8#9 { ( #1*#9 + #2*#8 + #3*#7 + #4*#6 ) \exp_after:wN \__fp_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c__fp_big_trailing_shift_int - \__fp_fixed_mul_add_iii:nnnnwnnwN + \__fp_fixed_mul_add:nnnnwnnwN { #6 + #4*#7 + #3*#8 + #2*#9 + #1 } { #7 + #4*#8 + #3*#9 + #2 } {#1} #5; {#6} } -\cs_new:Npn \__fp_fixed_mul_add_iii:nnnnwnnwN #1#2 #3#4#5; #6#7#8; #9 +\cs_new:Npn \__fp_fixed_mul_add:nnnnwnnwN #1#2 #3#4#5; #6#7#8; #9 { #9 (#4* #1 *#7) #9 (#5*#6+#4* #2 *#7+#3*#8) / \c_ten_thousand @@ -3092,32 +3092,32 @@ #2 \c_two * \c__fp_max_exponent_int \use_i_ii:nnn \fi: - \__fp_fixed_dtf_zeros_ii:ww + \__fp_fixed_dtf_zeros_auxi:ww #1#3 0000 0000 0000 0000 0000 0000 ; } -\cs_new:Npn \__fp_fixed_dtf_zeros_ii:ww +\cs_new:Npn \__fp_fixed_dtf_zeros_auxi:ww { \__fp_pack_twice_four:wNNNNNNNN \__fp_pack_twice_four:wNNNNNNNN \__fp_pack_twice_four:wNNNNNNNN - \__fp_fixed_dtf_zeros_iii:ww + \__fp_fixed_dtf_zeros_auxii:ww ; } -\cs_new:Npn \__fp_fixed_dtf_zeros_iii:ww #1; #2; #3 { #3 #1; } +\cs_new:Npn \__fp_fixed_dtf_zeros_auxii:ww #1; #2; #3 { #3 #1; } \cs_new:Npn \__fp_fixed_dtf_approx:n #1 { - \exp_after:wN \__fp_fixed_dtf_approx_ii:wnn + \exp_after:wN \__fp_fixed_dtf_approx:wnn \int_use:N \__int_eval:w 10 0000 0000 / ( #1 + \c_one ) ; {#1} } -\cs_new:Npn \__fp_fixed_dtf_approx_ii:wnn #1; #2#3 +\cs_new:Npn \__fp_fixed_dtf_approx:wnn #1; #2#3 { - \exp_after:wN \__fp_fixed_dtf_approx_iii:NNNNNw + \exp_after:wN \__fp_fixed_dtf_approx:NNNNNw \int_use:N \__int_eval:w 10 0000 0000 - 1750 + #1000 + (10 0000 0000/#2-#1) * (1000-#3/10) ; {#2}{#3} } -\cs_new:Npn \__fp_fixed_dtf_approx_iii:NNNNNw 1#1#2#3#4#5#6; #7; #8; +\cs_new:Npn \__fp_fixed_dtf_approx:NNNNNw 1#1#2#3#4#5#6; #7; #8; { + \c_four % because of the line below "dtf_epsilon" here. \__fp_fixed_mul:wwn {000#1}{#2#3#4#5}{#6}{0000}{0000}{0000} ; #7; @@ -3128,14 +3128,14 @@ } \cs_new:Npn \__fp_fixed_dtf_epsilon:wN #1#2#3#4#5#6; { - \exp_after:wN \__fp_fixed_dtf_epsilon_ii:NNNNNww + \exp_after:wN \__fp_fixed_dtf_epsilon:NNNNNww \int_use:N \__int_eval:w 1 9999 9998 - #3#4 + \exp_after:wN \__fp_fixed_dtf_epsilon_pack:NNNNNw \int_use:N \__int_eval:w 2 0000 0000 - #5#6 ; {0000} ; } \cs_new:Npn \__fp_fixed_dtf_epsilon_pack:NNNNNw #1#2#3#4#5#6; { #1 ; {#2#3#4#5} {#6} } -\cs_new:Npn \__fp_fixed_dtf_epsilon_ii:NNNNNww #1#2#3#4#5#6; #7; +\cs_new:Npn \__fp_fixed_dtf_epsilon:NNNNNww #1#2#3#4#5#6; #7; { \__fp_fixed_mul:wwn %^^A todo: optimize to use \__fp_mul_significand. {0000} {#2#3#4#5} {#6} #7 ; @@ -4020,19 +4020,19 @@ \prg_replicate:nn { - #1 } { 0 } #2#3#4#5 0000 0000 ; } \cs_new:Npn \__fp_trig_large:ww #1; #2#3; - { \__fp_trig_large_i:www #2; #3 ; #1; } -\cs_new:Npn \__fp_trig_large_i:www #1; #2; #3; + { \__fp_trig_large:www #2; #3 ; #1; } +\cs_new:Npn \__fp_trig_large:www #1; #2; #3; { \if_meaning:w 0 #3 \__fp_trig_large_break:w \fi: - \exp_after:wN \__fp_trig_large_ii_o:wnnnn + \exp_after:wN \__fp_trig_large_o:wnnnn \int_use:N \__int_eval:w ( #1 - 3141 ) / 6283 ; {#1} #2 \exp_after:wN ; \int_use:N \__int_eval:w \c_minus_one + #3; } -\cs_new:Npn \__fp_trig_large_ii_o:wnnnn #1; #2#3#4#5 +\cs_new:Npn \__fp_trig_large_o:wnnnn #1; #2#3#4#5 { - \exp_after:wN \__fp_trig_large_i:www + \exp_after:wN \__fp_trig_large:www \int_use:N \__int_eval:w \c__fp_leading_shift_int + #20 - #1*62831 \exp_after:wN \__fp_pack:NNNNNw \int_use:N \__int_eval:w \c__fp_middle_shift_int + #30 - #1*8530 @@ -4403,12 +4403,12 @@ } \cs_new:Npn \__fp_from_dim:Nw #1 #2; { - \__fp_pack_twice_four:wNNNNNNNN \__fp_from_dim_ii:wNNnnnnnn ; + \__fp_pack_twice_four:wNNNNNNNN \__fp_from_dim:wNNnnnnnn ; #2 000 0000 00 {10}987654321; #1 } -\cs_new:Npn \__fp_from_dim_ii:wNNnnnnnn #1; #2#3#4#5#6#7#8#9 - { \__fp_from_dim_iii:wnnnnwN #1 {#2#300} {0000} ; } -\cs_new:Npn \__fp_from_dim_iii:wnnnnwN #1; #2#3#4#5#6; #7 +\cs_new:Npn \__fp_from_dim:wNNnnnnnn #1; #2#3#4#5#6#7#8#9 + { \__fp_from_dim:wnnnnwN #1 {#2#300} {0000} ; } +\cs_new:Npn \__fp_from_dim:wnnnnwN #1; #2#3#4#5#6; #7 { \__fp_mul_npos_o:Nww #7 \s__fp \__fp_chk:w 1 #7 {#5} #1 ; |