diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx | 77 |
1 files changed, 70 insertions, 7 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx index 6238ad6ddd7..4dcf58decfb 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2019-09-19} +% \date{Released 2019-09-28} % % \maketitle % @@ -58,8 +58,55 @@ % close to that of \pkg{l3intarray}. The size of the array is fixed and % must be given at point of initialisation % -% Currently \emph{all} functions in this module are candidates. Their -% documentation can be found in \pkg{l3candidates}. +% \begin{function}[added = 2018-05-05]{\fparray_new:Nn} +% \begin{syntax} +% \cs{fparray_new:Nn} \meta{fparray~var} \Arg{size} +% \end{syntax} +% Evaluates the integer expression \meta{size} and allocates an +% \meta{floating point array variable} with that number of (zero) +% entries. The variable name should start with |\g_| because +% assignments are always global. +% \end{function} +% +% \begin{function}[EXP, added = 2018-05-05]{\fparray_count:N} +% \begin{syntax} +% \cs{fparray_count:N} \meta{fparray~var} +% \end{syntax} +% Expands to the number of entries in the \meta{floating point array +% variable}. This is performed in constant time. +% \end{function} +% +% \begin{function}[added = 2018-05-05]{\fparray_gset:Nnn} +% \begin{syntax} +% \cs{fparray_gset:Nnn} \meta{fparray~var} \Arg{position} \Arg{value} +% \end{syntax} +% Stores the result of evaluating the floating point expression +% \meta{value} into the \meta{floating point array variable} at the +% (integer expression) \meta{position}. If the \meta{position} is not +% between $1$ and the \cs{fparray_count:N}, an error occurs. +% Assignments are always global. +% \end{function} +% +% \begin{function}[added = 2018-05-05]{\fparray_gzero:N} +% \begin{syntax} +% \cs{fparray_gzero:N} \meta{fparray~var} +% \end{syntax} +% Sets all entries of the \meta{floating point array variable} to +% $+0$. Assignments are always global. +% \end{function} +% +% \begin{function}[EXP, added = 2018-05-05] +% {\fparray_item:Nn, \fparray_item_to_tl:Nn} +% \begin{syntax} +% \cs{fparray_item:Nn} \meta{fparray~var} \Arg{position} +% \end{syntax} +% Applies \cs{fp_use:N} or \cs{fp_to_tl:N} (respectively) to the +% floating point entry stored at the (integer expression) +% \meta{position} in the \meta{floating point array variable}. If the +% \meta{position} is not between $1$ and the \cs{fparray_count:N}, an +% error occurs. +% \end{function} + % % \end{documentation} % @@ -102,7 +149,8 @@ % \end{macrocode} % \end{variable} % -% \begin{macro}{\fparray_new:Nn, \@@_array_new:nNNN} +% \begin{macro}{\fparray_new:Nn, \fparray_new:cn} +% \begin{macro}{\@@_array_new:nNNN} % Build a three token token list, then define all three tokens to be % integer arrays of the same size. No need to initialize the data: % the integer arrays start with zeros, and three zeros denote @@ -120,6 +168,7 @@ \exp_last_unbraced:Nfo \@@_array_new:nNNNN { \int_eval:n {#2} } #1 #1 } +\cs_generate_variant:Nn \fparray_new:Nn { c } \cs_new_protected:Npn \@@_array_new:nNNNN #1#2#3#4#5 { \int_compare:nNnTF {#1} < 0 @@ -136,8 +185,9 @@ } % \end{macrocode} % \end{macro} +% \end{macro} % -% \begin{macro}[EXP]{\fparray_count:N} +% \begin{macro}[EXP]{\fparray_count:N, \fparray_count:c} % Size of any of the intarrays, here we pick the third. % \begin{macrocode} \cs_new:Npn \fparray_count:N #1 @@ -145,6 +195,7 @@ \exp_after:wN \use_i:nnn \exp_after:wN \intarray_count:N #1 } +\cs_generate_variant:Nn \fparray_count:N { c } % \end{macrocode} % \end{macro} % @@ -178,9 +229,10 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\fparray_gset:Nnn, \fparray_gset:cnn} % \begin{macro} % { -% \fparray_gset:Nnn, \@@_array_gset:NNNNww, \@@_array_gset:w, +% \@@_array_gset:NNNNww, \@@_array_gset:w, % \@@_array_gset_recover:Nw, \@@_array_gset_special:nnNNN, % \@@_array_gset_normal:w % } @@ -196,6 +248,7 @@ \int_value:w \int_eval:n {#2} \exp_after:wN ; \exp:w \exp_end_continue_f:w \@@_parse:n {#3} } +\cs_generate_variant:Nn \fparray_gset:Nnn { c } \cs_new_protected:Npn \@@_array_gset:NNNNww #1#2#3#4#5 ; #6 ; { \@@_array_bounds:NNnTF \__kernel_msg_error:nnxxx #4 {#5} @@ -239,8 +292,9 @@ } % \end{macrocode} % \end{macro} +% \end{macro} % -% \begin{macro}{\fparray_gzero:N} +% \begin{macro}{\fparray_gzero:N, \fparray_gzero:c} % \begin{macrocode} \cs_new_protected:Npn \fparray_gzero:N #1 { @@ -254,13 +308,19 @@ #1 } } +\cs_generate_variant:Nn \fparray_gzero:N { c } % \end{macrocode} % \end{macro} % % \begin{macro}[EXP] % { % \fparray_item:Nn, +% \fparray_item:cn, % \fparray_item_to_tl:Nn, +% \fparray_item_to_tl:cn, +% } +% \begin{macro}[EXP] +% { % \@@_array_item:NwN, % \@@_array_item:NNNnN, % \@@_array_item:N, @@ -276,6 +336,7 @@ \int_value:w \int_eval:n {#2} ; \@@_to_decimal:w } +\cs_generate_variant:Nn \fparray_item:Nn { c } \cs_new:Npn \fparray_item_to_tl:Nn #1#2 { \exp_after:wN \@@_array_item:NwN @@ -283,6 +344,7 @@ \int_value:w \int_eval:n {#2} ; \@@_to_tl:w } +\cs_generate_variant:Nn \fparray_item_to_tl:Nn { c } \cs_new:Npn \@@_array_item:NwN #1#2 ; #3 { \@@_array_bounds:NNnTF \__kernel_msg_expandable_error:nnfff #1 {#2} @@ -323,6 +385,7 @@ { #9 \s_@@ \@@_chk:w 1 #1 {#8} #7 {#2#3#4#5} {#6} ; } % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macrocode} %</initex|package> |