diff options
author | Karl Berry <karl@freefriends.org> | 2016-03-26 22:56:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-03-26 22:56:01 +0000 |
commit | acbc4b3c1d3629ae290305ff7c6056eb83d1151c (patch) | |
tree | 59c4ad13167b9bad138b2c231cbd6bc9f2c9c311 /Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx | |
parent | 473c539aefe98fc932ea0ed651464b9f91482938 (diff) |
l3 (26mar16)
git-svn-id: svn://tug.org/texlive/trunk@40146 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx | 150 |
1 files changed, 75 insertions, 75 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx index 177e8246a94..cc540f60ee4 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-basics.dtx Copyright (C) 2011-2014 The LaTeX3 Project +%% File: l3fp-basics.dtx Copyright (C) 2011-2014,2016 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -36,7 +36,7 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-basics.dtx 5354 2014-08-23 01:35:39Z bruno $ +\GetIdInfo$Id: l3fp-basics.dtx 6441 2016-03-24 10:11:59Z joseph $ {L3 Floating-point arithmetic} \begin{document} \DocInput{\jobname.dtx} @@ -336,7 +336,7 @@ { \exp_after:wN \@@_sanitize:Nw \exp_after:wN #1 - \int_use:N \__int_eval:w + \__int_value:w \__int_eval:w \if_int_compare:w #2 > #5 \exp_stop_f: #2 \exp_after:wN \@@_add_big_i_o:wNww \__int_value:w - @@ -400,9 +400,9 @@ \cs_new:Npn \@@_add_significand_o:NnnwnnnnN #1 #2#3 #4; #5#6#7#8 { \exp_after:wN \@@_add_significand_test_o:N - \int_use:N \__int_eval:w 1#5#6 + #2 + \__int_value:w \__int_eval:w 1#5#6 + #2 \exp_after:wN \@@_add_significand_pack:NNNNNNN - \int_use:N \__int_eval:w 1#7#8 + #3 ; #1 + \__int_value:w \__int_eval:w 1#7#8 + #3 ; #1 } \cs_new:Npn \@@_add_significand_pack:NNNNNNN #1 #2#3#4#5#6#7 { @@ -437,9 +437,9 @@ #1; #2; #3#4 ; #5#6 { \exp_after:wN \@@_basics_pack_high:NNNNNw - \int_use:N \__int_eval:w 1 #1 + \__int_value:w \__int_eval:w 1 #1 \exp_after:wN \@@_basics_pack_low:NNNNNw - \int_use:N \__int_eval:w 1 #2 #3#4 + \__int_value:w \__int_eval:w 1 #2 #3#4 + \@@_round:NNN #6 #4 #5 \exp_after:wN ; } @@ -460,9 +460,9 @@ { + \c_one \exp_after:wN \@@_basics_pack_weird_high:NNNNNNNNw - \int_use:N \__int_eval:w 1 1 #1 + \__int_value:w \__int_eval:w 1 1 #1 \exp_after:wN \@@_basics_pack_weird_low:NNNNw - \int_use:N \__int_eval:w 1 #2#3 + + \__int_value:w \__int_eval:w 1 #2#3 + \exp_after:wN \@@_round:NNN \exp_after:wN #6 \exp_after:wN #3 @@ -503,7 +503,7 @@ \cs_new:Npn \@@_sub_npos_ii_o:Nnwnw #1 #2; #3; { \exp_after:wN \@@_sub_npos_i_o:Nnwnw - \int_use:N \__int_eval:w \c_two - #1 \__int_eval_end: + \__int_value:w \__int_eval:w \c_two - #1 \__int_eval_end: #3; #2; } % \end{macrocode} @@ -525,13 +525,13 @@ { \exp_after:wN \@@_sanitize:Nw \exp_after:wN #1 - \int_use:N \__int_eval:w + \__int_value:w \__int_eval:w #2 \if_int_compare:w #2 = #4 \exp_stop_f: \exp_after:wN \@@_sub_back_near_o:nnnnnnnnN \else: \exp_after:wN \@@_decimate:nNnnnn \exp_after:wN - { \int_use:N \__int_eval:w #2 - #4 - \c_one \exp_after:wN } + { \__int_value:w \__int_eval:w #2 - #4 - \c_one \exp_after:wN } \exp_after:wN \@@_sub_back_far_o:NnnwnnnnN \fi: #5 @@ -560,9 +560,9 @@ \cs_new:Npn \@@_sub_back_near_o:nnnnnnnnN #1#2#3#4 #5#6#7#8 #9 { \exp_after:wN \@@_sub_back_near_after:wNNNNw - \int_use:N \__int_eval:w 10#5#6 - #1#2 - \c_eleven + \__int_value:w \__int_eval:w 10#5#6 - #1#2 - \c_eleven \exp_after:wN \@@_sub_back_near_pack:NNNNNNw - \int_use:N \__int_eval:w 11#7#8 - #3#4 \exp_after:wN ; + \__int_value:w \__int_eval:w 11#7#8 - #3#4 \exp_after:wN ; } \cs_new:Npn \@@_sub_back_near_pack:NNNNNNw #1#2#3#4#5#6#7 ; { + #1#2 ; {#3#4#5#6} {#7} ; } @@ -717,9 +717,9 @@ { - \c_one \exp_after:wN \@@_sub_back_near_after:wNNNNw - \int_use:N \__int_eval:w 1#30 - #1 - \c_eleven + \__int_value:w \__int_eval:w 1#30 - #1 - \c_eleven \exp_after:wN \@@_sub_back_near_pack:NNNNNNw - \int_use:N \__int_eval:w 11 0000 0000 + #40 - #2 + \__int_value:w \__int_eval:w 11 0000 0000 + #40 - #2 - \exp_after:wN \@@_round_neg:NNN \exp_after:wN #6 \use_none:nnnnnnn #2 #5 @@ -750,9 +750,9 @@ \cs_new:Npn \@@_sub_back_very_far_ii_o:nnNwwNN #1#2 ; #3 ; #4 ~ #5; #6#7 { \exp_after:wN \@@_basics_pack_high:NNNNNw - \int_use:N \__int_eval:w 1#4 - #1 - \c_one + \__int_value:w \__int_eval:w 1#4 - #1 - \c_one \exp_after:wN \@@_basics_pack_low:NNNNNw - \int_use:N \__int_eval:w 2#5 - #2 + \__int_value:w \__int_eval:w 2#5 - #2 - \exp_after:wN \@@_round_neg:NNN \exp_after:wN #7 \__int_value:w @@ -872,7 +872,7 @@ { \exp_after:wN \@@_sanitize:Nw \exp_after:wN #1 - \int_use:N \__int_eval:w + \__int_value:w \__int_eval:w #4 + #8 \@@_mul_significand_o:nnnnNnnnn #5 #1 #9 } @@ -907,19 +907,19 @@ { \exp_after:wN \@@_mul_significand_test_f:NNN \exp_after:wN #5 - \int_use:N \__int_eval:w 99990000 + #1*#6 + + \__int_value:w \__int_eval:w 99990000 + #1*#6 + \exp_after:wN \@@_mul_significand_keep:NNNNNw - \int_use:N \__int_eval:w 99990000 + #1*#7 + #2*#6 + + \__int_value:w \__int_eval:w 99990000 + #1*#7 + #2*#6 + \exp_after:wN \@@_mul_significand_keep:NNNNNw - \int_use:N \__int_eval:w 99990000 + #1*#8 + #2*#7 + #3*#6 + + \__int_value:w \__int_eval:w 99990000 + #1*#8 + #2*#7 + #3*#6 + \exp_after:wN \@@_mul_significand_drop:NNNNNw - \int_use:N \__int_eval:w 99990000 + #1*#9 + #2*#8 + #3*#7 + #4*#6 + + \__int_value:w \__int_eval:w 99990000 + #1*#9 + #2*#8 + #3*#7 + #4*#6 + \exp_after:wN \@@_mul_significand_drop:NNNNNw - \int_use:N \__int_eval:w 99990000 + #2*#9 + #3*#8 + #4*#7 + + \__int_value:w \__int_eval:w 99990000 + #2*#9 + #3*#8 + #4*#7 + \exp_after:wN \@@_mul_significand_drop:NNNNNw - \int_use:N \__int_eval:w 99990000 + #3*#9 + #4*#8 + + \__int_value:w \__int_eval:w 99990000 + #3*#9 + #4*#8 + \exp_after:wN \@@_mul_significand_drop:NNNNNw - \int_use:N \__int_eval:w 100000000 + #4*#9 ; + \__int_value:w \__int_eval:w 100000000 + #4*#9 ; ; \exp_after:wN ; } \cs_new:Npn \@@_mul_significand_drop:NNNNNw #1#2#3#4#5 #6; @@ -967,9 +967,9 @@ \cs_new:Npn \@@_mul_significand_large_f:NwwNNNN #1 #2; #3; #4#5#6#7; + { \exp_after:wN \@@_basics_pack_high:NNNNNw - \int_use:N \__int_eval:w 1#2 + \__int_value:w \__int_eval:w 1#2 \exp_after:wN \@@_basics_pack_low:NNNNNw - \int_use:N \__int_eval:w 1#3#4#5#6#7 + \__int_value:w \__int_eval:w 1#3#4#5#6#7 + \exp_after:wN \@@_round:NNN \exp_after:wN #1 \exp_after:wN #7 @@ -990,9 +990,9 @@ { - \c_one \exp_after:wN \@@_basics_pack_high:NNNNNw - \int_use:N \__int_eval:w 1#3#4 + \__int_value:w \__int_eval:w 1#3#4 \exp_after:wN \@@_basics_pack_low:NNNNNw - \int_use:N \__int_eval:w 1#5#6#7 + \__int_value:w \__int_eval:w 1#5#6#7 + \exp_after:wN \@@_round:NNN \exp_after:wN #1 \exp_after:wN #7 @@ -1060,10 +1060,10 @@ { \exp_after:wN \@@_sanitize:Nw \exp_after:wN #1 - \int_use:N \__int_eval:w + \__int_value:w \__int_eval:w #3 - #6 \exp_after:wN \@@_div_significand_i_o:wnnw - \int_use:N \__int_eval:w #7 \use_i:nnnn #8 + \c_one ; + \__int_value:w \__int_eval:w #7 \use_i:nnnn #8 + \c_one ; #4 {#7}{#8}#9 ; #1 @@ -1259,9 +1259,9 @@ \cs_new:Npn \@@_div_significand_i_o:wnnw #1 ; #2#3 #4 ; { \exp_after:wN \@@_div_significand_test_o:w - \int_use:N \__int_eval:w + \__int_value:w \__int_eval:w \exp_after:wN \@@_div_significand_calc:wwnnnnnnn - \int_use:N \__int_eval:w 999999 + #2 #3 0 / #1 ; + \__int_value:w \__int_eval:w 999999 + #2 #3 0 / #1 ; #2 #3 ; #4 { \exp_after:wN \@@_div_significand_ii:wwn \__int_value:w #1 } @@ -1343,16 +1343,16 @@ { 1 1 #1 #9 \exp_after:wN ; - \int_use:N \__int_eval:w \c_@@_Bigg_leading_shift_int + \__int_value:w \__int_eval:w \c_@@_Bigg_leading_shift_int + #2 - #1 * #5 - #5#60 \exp_after:wN \@@_pack_Bigg:NNNNNNw - \int_use:N \__int_eval:w \c_@@_Bigg_middle_shift_int + \__int_value:w \__int_eval:w \c_@@_Bigg_middle_shift_int + #3 - #1 * #6 - #70 \exp_after:wN \@@_pack_Bigg:NNNNNNw - \int_use:N \__int_eval:w \c_@@_Bigg_middle_shift_int + \__int_value:w \__int_eval:w \c_@@_Bigg_middle_shift_int + #4 - #1 * #7 - #80 \exp_after:wN \@@_pack_Bigg:NNNNNNw - \int_use:N \__int_eval:w \c_@@_Bigg_trailing_shift_int + \__int_value:w \__int_eval:w \c_@@_Bigg_trailing_shift_int - #1 * #8 ; {#5}{#6}{#7}{#8} } @@ -1360,16 +1360,16 @@ { 1 0 #1 #9 \exp_after:wN ; - \int_use:N \__int_eval:w \c_@@_Bigg_leading_shift_int + \__int_value:w \__int_eval:w \c_@@_Bigg_leading_shift_int + #2 - #1 * #5 \exp_after:wN \@@_pack_Bigg:NNNNNNw - \int_use:N \__int_eval:w \c_@@_Bigg_middle_shift_int + \__int_value:w \__int_eval:w \c_@@_Bigg_middle_shift_int + #3 - #1 * #6 \exp_after:wN \@@_pack_Bigg:NNNNNNw - \int_use:N \__int_eval:w \c_@@_Bigg_middle_shift_int + \__int_value:w \__int_eval:w \c_@@_Bigg_middle_shift_int + #4 - #1 * #7 \exp_after:wN \@@_pack_Bigg:NNNNNNw - \int_use:N \__int_eval:w \c_@@_Bigg_trailing_shift_int + \__int_value:w \__int_eval:w \c_@@_Bigg_trailing_shift_int - #1 * #8 ; {#5}{#6}{#7}{#8} } @@ -1396,9 +1396,9 @@ \cs_new:Npn \@@_div_significand_ii:wwn #1; #2;#3 { \exp_after:wN \@@_div_significand_pack:NNN - \int_use:N \__int_eval:w + \__int_value:w \__int_eval:w \exp_after:wN \@@_div_significand_calc:wwnnnnnnn - \int_use:N \__int_eval:w 999999 + #2 #3 0 / #1 ; #2 #3 ; + \__int_value:w \__int_eval:w 999999 + #2 #3 0 / #1 ; #2 #3 ; } % \end{macrocode} % \end{macro} @@ -1418,7 +1418,7 @@ { 0 \exp_after:wN \@@_div_significand_iv:wwnnnnnnn - \int_use:N \__int_eval:w (\c_two * #2 #3) / #6 #7 ; % <- P + \__int_value:w \__int_eval:w (\c_two * #2 #3) / #6 #7 ; % <- P #2 ; {#3} {#4} {#5} {#6} {#7} } @@ -1477,11 +1477,11 @@ { + \c_five * #1 \exp_after:wN \@@_div_significand_vi:Nw - \int_use:N \__int_eval:w -20 + 2*#2#3 - #1*#6#7 + + \__int_value:w \__int_eval:w -20 + 2*#2#3 - #1*#6#7 + \exp_after:wN \@@_div_significand_v:NN - \int_use:N \__int_eval:w 199980 + 2*#4 - #1*#8 + + \__int_value:w \__int_eval:w 199980 + 2*#4 - #1*#8 + \exp_after:wN \@@_div_significand_v:NN - \int_use:N \__int_eval:w 200000 + 2*#5 - #1*#9 ; + \__int_value:w \__int_eval:w 200000 + 2*#5 - #1*#9 ; } \cs_new:Npn \@@_div_significand_v:NN #1#2 { #1#2 \__int_eval_end: + } \cs_new:Npn \@@_div_significand_vi:Nw #1#2; @@ -1557,9 +1557,9 @@ 0 #1; #2; #3; #4#5#6#7#8; #9 { \exp_after:wN \@@_basics_pack_high:NNNNNw - \int_use:N \__int_eval:w 1 #1#2 + \__int_value:w \__int_eval:w 1 #1#2 \exp_after:wN \@@_basics_pack_low:NNNNNw - \int_use:N \__int_eval:w 1 #3#4#5#6#7 + \__int_value:w \__int_eval:w 1 #3#4#5#6#7 + \@@_round:NNN #9 #7 #8 \exp_after:wN ; } @@ -1581,9 +1581,9 @@ { + \c_one \exp_after:wN \@@_basics_pack_weird_high:NNNNNNNNw - \int_use:N \__int_eval:w 1 #1 #2 + \__int_value:w \__int_eval:w 1 #1 #2 \exp_after:wN \@@_basics_pack_weird_low:NNNNw - \int_use:N \__int_eval:w 1 #3 #4 #5 #6 + + \__int_value:w \__int_eval:w 1 #3 #4 #5 #6 + \exp_after:wN \@@_round:NNN \exp_after:wN #9 \exp_after:wN #6 @@ -1631,7 +1631,7 @@ { \exp_after:wN \@@_sanitize:Nw \exp_after:wN 0 - \int_use:N \__int_eval:w + \__int_value:w \__int_eval:w \if_int_odd:w #1 \exp_stop_f: \exp_after:wN \@@_sqrt_npos_auxi_o:wwnnN \fi: @@ -1720,11 +1720,11 @@ { \if_int_compare:w #1 = #2 \exp_stop_f: \exp_after:wN \@@_sqrt_auxi_o:NNNNwnnN - \int_use:N \__int_eval:w 9999 9999 + + \__int_value:w \__int_eval:w 9999 9999 + \exp_after:wN \@@_use_none_until_s:w \fi: \exp_after:wN \@@_sqrt_Newton_o:wwn - \int_use:N \__int_eval:w (#1 + #3 * 1 0000 0000 / #1) / \c_two ; + \__int_value:w \__int_eval:w (#1 + #3 * 1 0000 0000 / #1) / \c_two ; #1; {#3} } % \end{macrocode} @@ -1813,32 +1813,32 @@ \cs_new:Npn \@@_sqrt_auxii_o:NnnnnnnnN #1 #2#3#4#5#6 #7#8#9 { \exp_after:wN #1 - \int_use:N \__int_eval:w \c_@@_big_leading_shift_int + \__int_value:w \__int_eval:w \c_@@_big_leading_shift_int + #7 - #2 * #2 \exp_after:wN \@@_pack_big:NNNNNNw - \int_use:N \__int_eval:w \c_@@_big_middle_shift_int + \__int_value:w \__int_eval:w \c_@@_big_middle_shift_int - 2 * #2 * #3 \exp_after:wN \@@_pack_big:NNNNNNw - \int_use:N \__int_eval:w \c_@@_big_middle_shift_int + \__int_value:w \__int_eval:w \c_@@_big_middle_shift_int + #8 - #3 * #3 - 2 * #2 * #4 \exp_after:wN \@@_pack_big:NNNNNNw - \int_use:N \__int_eval:w \c_@@_big_middle_shift_int + \__int_value:w \__int_eval:w \c_@@_big_middle_shift_int - 2 * #3 * #4 - 2 * #2 * #5 \exp_after:wN \@@_pack_big:NNNNNNw - \int_use:N \__int_eval:w \c_@@_big_middle_shift_int + \__int_value:w \__int_eval:w \c_@@_big_middle_shift_int + #9 000 0000 - #4 * #4 - 2 * #3 * #5 - 2 * #2 * #6 \exp_after:wN \@@_pack_big:NNNNNNw - \int_use:N \__int_eval:w \c_@@_big_middle_shift_int + \__int_value:w \__int_eval:w \c_@@_big_middle_shift_int - 2 * #4 * #5 - 2 * #3 * #6 \exp_after:wN \@@_pack_big:NNNNNNw - \int_use:N \__int_eval:w \c_@@_big_middle_shift_int + \__int_value:w \__int_eval:w \c_@@_big_middle_shift_int - #5 * #5 - 2 * #4 * #6 \exp_after:wN \@@_pack_big:NNNNNNw - \int_use:N \__int_eval:w + \__int_value:w \__int_eval:w \c_@@_big_middle_shift_int - 2 * #5 * #6 \exp_after:wN \@@_pack_big:NNNNNNw - \int_use:N \__int_eval:w + \__int_value:w \__int_eval:w \c_@@_big_trailing_shift_int - #6 * #6 ; % ( @@ -1896,18 +1896,18 @@ { \if_int_compare:w #1 > \c_one \exp_after:wN \@@_sqrt_auxiv_o:NNNNNw - \int_use:N \__int_eval:w (#1#2 %) + \__int_value:w \__int_eval:w (#1#2 %) \else: \if_int_compare:w #1#2 > \c_one \exp_after:wN \@@_sqrt_auxv_o:NNNNNw - \int_use:N \__int_eval:w (#1#2#3 %) + \__int_value:w \__int_eval:w (#1#2#3 %) \else: \if_int_compare:w #1#2#3 > \c_one \exp_after:wN \@@_sqrt_auxvi_o:NNNNNw - \int_use:N \__int_eval:w (#1#2#3#4 %) + \__int_value:w \__int_eval:w (#1#2#3#4 %) \else: \exp_after:wN \@@_sqrt_auxvii_o:NNNNNw - \int_use:N \__int_eval:w (#1#2#3#4#5 %) + \__int_value:w \__int_eval:w (#1#2#3#4#5 %) \fi: \fi: \fi: @@ -1937,11 +1937,11 @@ \cs_new:Npn \@@_sqrt_auxviii_o:nnnnnnn #1#2 #3#4#5#6#7 { \exp_after:wN \@@_sqrt_auxix_o:wnwnw - \int_use:N \__int_eval:w #3 + \__int_value:w \__int_eval:w #3 \exp_after:wN \@@_basics_pack_low:NNNNNw - \int_use:N \__int_eval:w #1 + 1#4#5 + \__int_value:w \__int_eval:w #1 + 1#4#5 \exp_after:wN \@@_basics_pack_low:NNNNNw - \int_use:N \__int_eval:w #2 + 1#6#7 ; + \__int_value:w \__int_eval:w #2 + 1#6#7 ; } \cs_new:Npn \@@_sqrt_auxix_o:wnwnw #1; #2#3; #4#5; { @@ -1987,7 +1987,7 @@ \cs_new:Npn \@@_sqrt_auxx_o:Nnnnnnnn #1#2#3 #4#5#6#7#8 { \exp_after:wN \@@_sqrt_auxxi_o:wwnnN - \int_use:N \__int_eval:w + \__int_value:w \__int_eval:w (#8 + 2499) / 5000 * 5000 ; {#4} {#5} {#6} {#7} ; } @@ -2065,9 +2065,9 @@ \cs_new:Npn \@@_sqrt_auxxiv_o:wnnnnnnnN #1; #2#3#4#5#6 #7#8#9 { \exp_after:wN \@@_basics_pack_high:NNNNNw - \int_use:N \__int_eval:w 1 0000 0000 + #2#3 + \__int_value:w \__int_eval:w 1 0000 0000 + #2#3 \exp_after:wN \@@_basics_pack_low:NNNNNw - \int_use:N \__int_eval:w 1 0000 0000 + \__int_value:w \__int_eval:w 1 0000 0000 + #4#5 \if_int_compare:w #6 > #1 \exp_stop_f: + \c_one \fi: + \exp_after:wN \@@_round:NNN @@ -2076,7 +2076,7 @@ \__int_value:w \exp_after:wN \use_i:nn \exp_after:wN \@@_round_digit:Nw - \int_use:N \__int_eval:w #6 + 19999 - #1 ; + \__int_value:w \__int_eval:w #6 + 19999 - #1 ; \exp_after:wN ; } % \end{macrocode} |