diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/expl3/l3fp.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/expl3/l3fp.dtx | 559 |
1 files changed, 302 insertions, 257 deletions
diff --git a/Master/texmf-dist/source/latex/expl3/l3fp.dtx b/Master/texmf-dist/source/latex/expl3/l3fp.dtx index a6fb183db8c..6232374336a 100644 --- a/Master/texmf-dist/source/latex/expl3/l3fp.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3fp.dtx @@ -1,5 +1,5 @@ % \iffalse -%% File: l3fp.dtx Copyright (C) 2010 LaTeX3 project +%% File: l3fp.dtx Copyright (C) 2010-2011 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 @@ -35,7 +35,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3fp.dtx 2129 2011-01-10 22:58:48Z joseph $ +\GetIdInfo$Id: l3fp.dtx 2178 2011-03-06 09:03:44Z mittelba $ {L3 Experimental floating-point operations} %\iffalse %<*driver> @@ -796,6 +796,8 @@ %\begin{implementation} % %\section{Implementation} +% +% \TestFiles{m3fp003.lvt} % % We start by ensuring that the required packages are loaded. % \begin{macrocode} @@ -809,13 +811,13 @@ % %\subsection{Constants} % -%\begin{macro}{\c_forty_four} -%\begin{macro}{\c_one_hundred} -%\begin{macro}{\c_one_thousand} -%\begin{macro}{\c_one_million} -%\begin{macro}{\c_one_hundred_million} -%\begin{macro}{\c_five_hundred_million} -%\begin{macro}{\c_one_thousand_million} +%\begin{macro}[aux]{\c_forty_four} +%\begin{macro}[aux]{\c_one_hundred} +%\begin{macro}[aux]{\c_one_thousand} +%\begin{macro}[aux]{\c_one_million} +%\begin{macro}[aux]{\c_one_hundred_million} +%\begin{macro}[aux]{\c_five_hundred_million} +%\begin{macro}[aux]{\c_one_thousand_million} % There is some speed to gain by moving numbers into fixed positions. % \begin{macrocode} \int_const:Nn \c_forty_four { 44 } @@ -834,12 +836,12 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\c_fp_pi_by_four_decimal_int} -%\begin{macro}{\c_fp_pi_by_four_extended_int} -%\begin{macro}{\c_fp_pi_decimal_int} -%\begin{macro}{\c_fp_pi_extended_int} -%\begin{macro}{\c_fp_two_pi_decimal_int} -%\begin{macro}{\c_fp_two_pi_extended_int} +%\begin{macro}[aux]{\c_fp_pi_by_four_decimal_int} +%\begin{macro}[aux]{\c_fp_pi_by_four_extended_int} +%\begin{macro}[aux]{\c_fp_pi_decimal_int} +%\begin{macro}[aux]{\c_fp_pi_extended_int} +%\begin{macro}[aux]{\c_fp_two_pi_decimal_int} +%\begin{macro}[aux]{\c_fp_two_pi_extended_int} % Parts of \( \pi \) for trigonometric range reduction, implemented % as \texttt{int} variables for speed. % \begin{macrocode} @@ -905,7 +907,7 @@ % %\subsection{Variables} % -%\begin{macro}{\l_fp_arg_tl} +%\begin{macro}[aux]{\l_fp_arg_tl} % A token list to store the formalised representation of the input % for transcendental functions. % \begin{macrocode} @@ -913,14 +915,14 @@ % \end{macrocode} %\end{macro} % -%\begin{macro}{\l_fp_count_int} +%\begin{macro}[aux]{\l_fp_count_int} % A counter for things like the number of divisions possible. % \begin{macrocode} \int_new:N \l_fp_count_int % \end{macrocode} %\end{macro} % -%\begin{macro}{\l_fp_div_offset_int} +%\begin{macro}[aux]{\l_fp_div_offset_int} % When carrying out division, an offset is used for the results to % get the decimal part correct. % \begin{macrocode} @@ -928,10 +930,10 @@ % \end{macrocode} %\end{macro} % -%\begin{macro}{\l_fp_exp_integer_int} -%\begin{macro}{\l_fp_exp_decimal_int} -%\begin{macro}{\l_fp_exp_extended_int} -%\begin{macro}{\l_fp_exp_exponent_int} +%\begin{macro}[aux]{\l_fp_exp_integer_int} +%\begin{macro}[aux]{\l_fp_exp_decimal_int} +%\begin{macro}[aux]{\l_fp_exp_extended_int} +%\begin{macro}[aux]{\l_fp_exp_exponent_int} % Used for the calculation of exponent values. % \begin{macrocode} \int_new:N \l_fp_exp_integer_int @@ -944,14 +946,14 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\l_fp_input_a_sign_int} -%\begin{macro}{\l_fp_input_a_integer_int} -%\begin{macro}{\l_fp_input_a_decimal_int} -%\begin{macro}{\l_fp_input_a_exponent_int} -%\begin{macro}{\l_fp_input_b_sign_int} -%\begin{macro}{\l_fp_input_b_integer_int} -%\begin{macro}{\l_fp_input_b_decimal_int} -%\begin{macro}{\l_fp_input_b_exponent_int} +%\begin{macro}[aux]{\l_fp_input_a_sign_int} +%\begin{macro}[aux]{\l_fp_input_a_integer_int} +%\begin{macro}[aux]{\l_fp_input_a_decimal_int} +%\begin{macro}[aux]{\l_fp_input_a_exponent_int} +%\begin{macro}[aux]{\l_fp_input_b_sign_int} +%\begin{macro}[aux]{\l_fp_input_b_integer_int} +%\begin{macro}[aux]{\l_fp_input_b_decimal_int} +%\begin{macro}[aux]{\l_fp_input_b_exponent_int} % Storage for the input: two storage areas as there are at most two % inputs. % \begin{macrocode} @@ -973,8 +975,8 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\l_fp_input_a_extended_int} -%\begin{macro}{\l_fp_input_b_extended_int} +%\begin{macro}[aux]{\l_fp_input_a_extended_int} +%\begin{macro}[aux]{\l_fp_input_b_extended_int} % For internal use, `extended' floating point numbers are % needed. % \begin{macrocode} @@ -984,18 +986,18 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\l_fp_mul_a_i_int} -%\begin{macro}{\l_fp_mul_a_ii_int} -%\begin{macro}{\l_fp_mul_a_iii_int} -%\begin{macro}{\l_fp_mul_a_iv_int} -%\begin{macro}{\l_fp_mul_a_v_int} -%\begin{macro}{\l_fp_mul_a_vi_int} -%\begin{macro}{\l_fp_mul_b_i_int} -%\begin{macro}{\l_fp_mul_b_ii_int} -%\begin{macro}{\l_fp_mul_b_iii_int} -%\begin{macro}{\l_fp_mul_b_iv_int} -%\begin{macro}{\l_fp_mul_b_v_int} -%\begin{macro}{\l_fp_mul_b_vi_int} +%\begin{macro}[aux]{\l_fp_mul_a_i_int} +%\begin{macro}[aux]{\l_fp_mul_a_ii_int} +%\begin{macro}[aux]{\l_fp_mul_a_iii_int} +%\begin{macro}[aux]{\l_fp_mul_a_iv_int} +%\begin{macro}[aux]{\l_fp_mul_a_v_int} +%\begin{macro}[aux]{\l_fp_mul_a_vi_int} +%\begin{macro}[aux]{\l_fp_mul_b_i_int} +%\begin{macro}[aux]{\l_fp_mul_b_ii_int} +%\begin{macro}[aux]{\l_fp_mul_b_iii_int} +%\begin{macro}[aux]{\l_fp_mul_b_iv_int} +%\begin{macro}[aux]{\l_fp_mul_b_v_int} +%\begin{macro}[aux]{\l_fp_mul_b_vi_int} % Multiplication requires that the decimal part is split into parts % so that there are no overflows. % \begin{macrocode} @@ -1025,8 +1027,8 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\l_fp_mul_output_int} -%\begin{macro}{\l_fp_mul_output_tl} +%\begin{macro}[aux]{\l_fp_mul_output_int} +%\begin{macro}[aux]{\l_fp_mul_output_tl} % Space for multiplication results. % \begin{macrocode} \int_new:N \l_fp_mul_output_int @@ -1035,10 +1037,10 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\l_fp_output_sign_int} -%\begin{macro}{\l_fp_output_integer_int} -%\begin{macro}{\l_fp_output_decimal_int} -%\begin{macro}{\l_fp_output_exponent_int} +%\begin{macro}[aux]{\l_fp_output_sign_int} +%\begin{macro}[aux]{\l_fp_output_integer_int} +%\begin{macro}[aux]{\l_fp_output_decimal_int} +%\begin{macro}[aux]{\l_fp_output_exponent_int} % Output is stored in the same way as input. % \begin{macrocode} \int_new:N \l_fp_output_sign_int @@ -1051,21 +1053,21 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\l_fp_output_extended_int} +%\begin{macro}[aux]{\l_fp_output_extended_int} % Again, for calculations an extended part. % \begin{macrocode} \int_new:N \l_fp_output_extended_int % \end{macrocode} %\end{macro} % -%\begin{macro}{\l_fp_round_carry_bool} +%\begin{macro}[aux]{\l_fp_round_carry_bool} % To indicate that a digit needs to be carried forward. % \begin{macrocode} \bool_new:N \l_fp_round_carry_bool % \end{macrocode} %\end{macro} % -%\begin{macro}{\l_fp_round_decimal_tl} +%\begin{macro}[aux]{\l_fp_round_decimal_tl} % A temporary store when rounding, to build up the decimal part without % needing to do any maths. % \begin{macrocode} @@ -1073,8 +1075,8 @@ % \end{macrocode} %\end{macro} % -%\begin{macro}{\l_fp_round_position_int} -%\begin{macro}{\l_fp_round_target_int} +%\begin{macro}[aux]{\l_fp_round_position_int} +%\begin{macro}[aux]{\l_fp_round_target_int} % Used to check the position for rounding. % \begin{macrocode} \int_new:N \l_fp_round_position_int @@ -1083,7 +1085,7 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\l_fp_sign_tl} +%\begin{macro}[aux]{\l_fp_sign_tl} % There are places where the sign needs to be set up `early', % so that the registers can be re-used. % \begin{macrocode} @@ -1091,7 +1093,7 @@ % \end{macrocode} %\end{macro} % -%\begin{macro}{\l_fp_split_sign_int} +%\begin{macro}[aux]{\l_fp_split_sign_int} % When splitting the input it is fastest to use a fixed name for the % sign part, and to transfer it after the split is complete. % \begin{macrocode} @@ -1099,7 +1101,7 @@ % \end{macrocode} %\end{macro} % -%\begin{macro}{\l_fp_tmp_int} +%\begin{macro}[aux]{\l_fp_tmp_int} % A scratch \texttt{int}: used only where the value is not carried % forward. % \begin{macrocode} @@ -1107,23 +1109,23 @@ % \end{macrocode} %\end{macro} % -%\begin{macro}{\l_fp_tmp_tl} +%\begin{macro}[aux]{\l_fp_tmp_tl} % A scratch token list variable for expanding material. % \begin{macrocode} \tl_new:N \l_fp_tmp_tl % \end{macrocode} %\end{macro} % -%\begin{macro}{\l_fp_trig_octant_int} +%\begin{macro}[aux]{\l_fp_trig_octant_int} % To track which octant the trigonometric input is in. % \begin{macrocode} \int_new:N \l_fp_trig_octant_int % \end{macrocode} %\end{macro} % -%\begin{macro}{\l_fp_trig_sign_int} -%\begin{macro}{\l_fp_trig_decimal_int} -%\begin{macro}{\l_fp_trig_extended_int} +%\begin{macro}[aux]{\l_fp_trig_sign_int} +%\begin{macro}[aux]{\l_fp_trig_decimal_int} +%\begin{macro}[aux]{\l_fp_trig_extended_int} % Used for the calculation of trigonometric values. % \begin{macrocode} \int_new:N \l_fp_trig_sign_int @@ -1411,7 +1413,7 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\fp_tmp:w} +%\begin{macro}[aux]{\fp_tmp:w} % Used for output of results, cutting down on \cs{tex_expandafter:D}. % This is just a place holder definition. % \begin{macrocode} @@ -1428,8 +1430,8 @@ % When stored, floating points will always be stored with a value in % the integer position unless the number is zero. % -%\begin{macro}{\fp_new:N} -%\begin{macro}{\fp_new:c} +%\begin{macro}{\fp_new:N, \fp_new:c} +%\UnitTested % Fixed-points always have a value, and of course this has to be % initialised globally. % \begin{macrocode} @@ -1440,10 +1442,9 @@ \cs_generate_variant:Nn \fp_new:N { c } % \end{macrocode} %\end{macro} -%\end{macro} % -%\begin{macro}{\fp_const:Nn} -%\begin{macro}{\fp_const:cn} +% +%\begin{macro}{\fp_const:Nn, \fp_const:cn} % A simple wrapper. % \begin{macrocode} \cs_new_protected_nopar:Npn \fp_const:Nn #1#2 { @@ -1460,12 +1461,11 @@ \cs_generate_variant:Nn \fp_const:Nn { c } % \end{macrocode} %\end{macro} -%\end{macro} % -%\begin{macro}{\fp_zero:N} -%\begin{macro}{\fp_zero:c} -%\begin{macro}{\fp_gzero:N} -%\begin{macro}{\fp_gzero:c} +%\begin{macro}{\fp_zero:N, \fp_zero:c } +%\UnitTested +%\begin{macro}{\fp_gzero:N, \fp_gzero:c } +%\UnitTested % Zeroing fixed-points is pretty obvious. % \begin{macrocode} \cs_new_protected_nopar:Npn \fp_zero:N #1 { @@ -1479,13 +1479,11 @@ % \end{macrocode} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} % -%\begin{macro}{\fp_set:Nn} -%\begin{macro}{\fp_set:cn} -%\begin{macro}{\fp_gset:Nn} -%\begin{macro}{\fp_gset:cn} +%\begin{macro}{\fp_set:Nn, \fp_set:cn} +%\UnitTested +%\begin{macro}{\fp_gset:Nn, \fp_gset:cn} +%\UnitTested %\begin{macro}[aux]{\fp_set_aux:NNn} % To trap any input errors, a very simple version of the parser is run % here. This will pick up any invalid characters at this stage, saving @@ -1533,17 +1531,17 @@ %\end{macro} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} % -%\begin{macro}{\fp_set_from_dim:Nn} -%\begin{macro}{\fp_set_from_dim:cn} -%\begin{macro}{\fp_gset_from_dim:Nn} -%\begin{macro}{\fp_gset_from_dim:cn} +% +% +%\begin{macro}{\fp_set_from_dim:Nn, \fp_set_from_dim:cn} +%\UnitTested +%\begin{macro}{\fp_gset_from_dim:Nn, \fp_gset_from_dim:cn} +%\UnitTested %\begin{macro}[aux]{\fp_set_from_dim_aux:NNn} %\begin{macro}[aux]{\fp_set_from_dim_aux:w} -%\begin{macro}{\l_fp_tmp_dim} -%\begin{macro}{\l_fp_tmp_skip} +%\begin{macro}[aux]{\l_fp_tmp_dim} +%\begin{macro}[aux]{\l_fp_tmp_skip} % Here, dimensions are converted to fixed-points \emph{via} a % temporary variable. This ensures that they always convert as points. % The code is then essentially the same as for \cs{fp_set:Nn}, but with @@ -1608,17 +1606,16 @@ %\end{macro} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} % -%\begin{macro}{\fp_set_eq:NN} -%\begin{macro}{\fp_set_eq:cN} -%\begin{macro}{\fp_set_eq:Nc} -%\begin{macro}{\fp_set_eq:cc} -%\begin{macro}{\fp_gset_eq:NN} -%\begin{macro}{\fp_gset_eq:cN} -%\begin{macro}{\fp_gset_eq:Nc} -%\begin{macro}{\fp_gset_eq:cc} +% +% +% +%\begin{macro}{\fp_set_eq:NN, \fp_set_eq:cN, +% \fp_set_eq:Nc, \fp_set_eq:cc} +%\UnitTested +%\begin{macro}{\fp_gset_eq:NN, \fp_gset_eq:cN, +% \fp_gset_eq:Nc, \fp_gset_eq:cc} +%\UnitTested % Pretty simple, really. % \begin{macrocode} \cs_new_eq:NN \fp_set_eq:NN \tl_set_eq:NN @@ -1632,25 +1629,22 @@ % \end{macrocode} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} -%\end{macro} -%\end{macro} -%\end{macro} -%\end{macro} % -%\begin{macro}{\fp_show:N} -%\begin{macro}{\fp_show:c} +% +% +%\begin{macro}{\fp_show:N, \fp_show:c} +%\UnitTested % Simple showing of the underlying variable. % \begin{macrocode} \cs_new_eq:NN \fp_show:N \tl_show:N \cs_new_eq:NN \fp_show:c \tl_show:c % \end{macrocode} %\end{macro} -%\end{macro} % -%\begin{macro}{\fp_use:N} -%\begin{macro}{\fp_use:c} +% +% +%\begin{macro}{\fp_use:N, \fp_use:c} +% \UnitTested %\begin{macro}[aux]{\fp_use_aux:w} %\begin{macro}[aux]{\fp_use_none:w} %\begin{macro}[aux]{\fp_use_small:w} @@ -1766,7 +1760,6 @@ %\end{macro} %\end{macro} %\end{macro} -%\end{macro} % %\subsection{Transferring to other types} % @@ -1774,18 +1767,17 @@ % a form that can be used by \TeX. Here, the functions are slightly % different, as some information may be discarded. % -%\begin{macro}{\fp_to_dim:N} -%\begin{macro}{\fp_to_dim:c} +%\begin{macro}{\fp_to_dim:N, \fp_to_dim:c} % A very simple wrapper. % \begin{macrocode} \cs_new_nopar:Npn \fp_to_dim:N #1 { \fp_use:N #1 pt } \cs_generate_variant:Nn \fp_to_dim:N { c } % \end{macrocode} %\end{macro} -%\end{macro} +% % -%\begin{macro}{\fp_to_int:N} -%\begin{macro}{\fp_to_int:c} +%\begin{macro}{\fp_to_int:N, \fp_to_int:c} +%\UnitTested %\begin{macro}[aux]{\fp_to_int_aux:w} %\begin{macro}[aux]{\fp_to_int_none:w} %\begin{macro}[aux]{\fp_to_int_small:w} @@ -1905,10 +1897,13 @@ %\end{macro} %\end{macro} %\end{macro} -%\end{macro} % -%\begin{macro}{\fp_to_tl:N} -%\begin{macro}{\fp_to_tl:c} +% +% +% +% +%\begin{macro}{\fp_to_tl:N, \fp_to_tl:c} +%\UnitTested %\begin{macro}[aux]{\fp_to_tl_aux:w} %\begin{macro}[aux]{\fp_to_tl_large:w} %\begin{macro}[aux]{\fp_to_tl_large_aux_i:w} @@ -2200,17 +2195,17 @@ %\end{macro} %\end{macro} %\end{macro} -%\end{macro} % %\subsection{Rounding numbers} % % The results may well need to be rounded. A couple of related functions % to do this for a stored value. % -%\begin{macro}{\fp_round_figures:Nn} -%\begin{macro}{\fp_round_figures:cn} -%\begin{macro}{\fp_ground_figures:Nn} -%\begin{macro}{\fp_ground_figures:cn} +% +%\begin{macro}{\fp_round_figures:Nn, \fp_round_figures:cn} +%\UnitTested +%\begin{macro}{\fp_ground_figures:Nn, \fp_ground_figures:cn} +%\UnitTested %\begin{macro}[aux]{\fp_round_figures_aux:NNn} % Rounding to figures needs only an adjustment to the target by one % (as the target is in decimal places). @@ -2252,16 +2247,16 @@ \fp_tmp:w } % \end{macrocode} -%\end{macro} -%\end{macro} %\end{macro} %\end{macro} %\end{macro} % -%\begin{macro}{\fp_round_places:Nn} -%\begin{macro}{\fp_round_places:cn} -%\begin{macro}{\fp_ground_places:Nn} -%\begin{macro}{\fp_ground_places:cn} +% +% +%\begin{macro}{\fp_round_places:Nn, \fp_round_places:cn} +%\UnitTested +%\begin{macro}{\fp_ground_places:Nn, \fp_ground_places:cn} +%\UnitTested %\begin{macro}[aux]{\fp_round_places_aux:NNn} % Rounding to places needs an adjustment for the exponent value, which % will mean that everything should be correct. @@ -2304,14 +2299,14 @@ \fp_tmp:w } % \end{macrocode} -%\end{macro} -%\end{macro} %\end{macro} %\end{macro} %\end{macro} % +% +% %\begin{macro}{\fp_round:} -%\begin{macro}{\fp_round_aux:NNNNNNNNN} +%\begin{macro}[aux]{\fp_round_aux:NNNNNNNNN} %\begin{macro}{\fp_round_loop:N} % The rounding approach is the same for decimal places and significant % figures. There are always nine decimal digits to round, so the code @@ -2370,12 +2365,15 @@ %\end{macro} %\end{macro} % +% +% +% %\subsection{Unary functions} % -%\begin{macro}{\fp_abs:N} -%\begin{macro}{\fp_abs:c} -%\begin{macro}{\fp_gabs:N} -%\begin{macro}{\fp_gabs:c} +%\begin{macro}{\fp_abs:N, \fp_abs:c} +%\UnitTested +%\begin{macro}{\fp_gabs:N, \fp_gabs:c} +%\UnitTested %\begin{macro}[aux]{\fp_abs_aux:NN} % Setting the absolute value is easy: read the value, ignore the sign, % return the result. @@ -2412,13 +2410,14 @@ %\end{macro} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} % -%\begin{macro}{\fp_neg:N} -%\begin{macro}{\fp_neg:c} -%\begin{macro}{\fp_gneg:N} -%\begin{macro}{\fp_gneg:c} +% +% +% +%\begin{macro}{\fp_neg:N, \fp_neg:c} +%\UnitTested +%\begin{macro}{\fp_gneg:N, \fp_gneg:c} +%\UnitTested %\begin{macro}[aux]{\fp_neg:NN} % Just a bit more complex: read the input, reverse the sign and % output the result. @@ -2456,15 +2455,15 @@ %\end{macro} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} +% +% % %\subsection{Basic arithmetic} % -%\begin{macro}{\fp_add:Nn} -%\begin{macro}{\fp_add:cn} -%\begin{macro}{\fp_gadd:Nn} -%\begin{macro}{\fp_gadd:cn} +%\begin{macro}{\fp_add:Nn, \fp_add:cn} +%\UnitTested +%\begin{macro}{\fp_gadd:Nn,\fp_gadd:cn} +%\UnitTested %\begin{macro}[aux]{\fp_add_aux:NNn} %\begin{macro}[aux]{\fp_add_core:} %\begin{macro}[aux]{\fp_add_sum:} @@ -2596,17 +2595,18 @@ % \end{macrocode} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} %\end{macro} %\end{macro} %\end{macro} %\end{macro} % -%\begin{macro}{\fp_sub:Nn} -%\begin{macro}{\fp_sub:cn} -%\begin{macro}{\fp_gsub:Nn} -%\begin{macro}{\fp_gsub:cn} +% +% +% +%\begin{macro}{\fp_sub:Nn, \fp_sub:cn} +%\UnitTested +%\begin{macro}{\fp_gsub:Nn,\fp_gsub:cn} +%\UnitTested %\begin{macro}[aux]{\fp_sub_aux:NNn} % Subtraction is essentially the same as addition, but with the sign % of the second component reversed. Thus the core of the two function @@ -2634,16 +2634,18 @@ \fp_tmp:w #1#2 } % \end{macrocode} -%\end{macro} -%\end{macro} %\end{macro} %\end{macro} %\end{macro} % -%\begin{macro}{\fp_mul:Nn} -%\begin{macro}{\fp_mul:cn} -%\begin{macro}{\fp_gmul:Nn} -%\begin{macro}{\fp_gmul:cn} +% +% +% +% +%\begin{macro}{\fp_mul:Nn, \fp_mul:cn} +%\UnitTested +%\begin{macro}{\fp_gmul:Nn,\fp_gmul:cn} +%\UnitTested %\begin{macro}[aux]{\fp_mul_aux:NNn} %\begin{macro}[aux]{\fp_mul_internal:} %\begin{macro}[aux]{\fp_mul_split:NNNN} @@ -2791,18 +2793,20 @@ %\end{macro} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} %\end{macro} %\end{macro} %\end{macro} %\end{macro} %\end{macro} % -%\begin{macro}{\fp_div:Nn} -%\begin{macro}{\fp_div:cn} -%\begin{macro}{\fp_gdiv:Nn} -%\begin{macro}{\fp_gdiv:cn} +% +% +% +% +%\begin{macro}{\fp_div:Nn, \fp_div:cn} +%\UnitTested +%\begin{macro}{\fp_gdiv:Nn,\fp_gdiv:cn} +%\UnitTested %\begin{macro}[aux]{\fp_div_aux:NNn} %\begin{macro}{\fp_div_internal:} %\begin{macro}[aux]{\fp_div_loop:} @@ -3000,8 +3004,6 @@ \l_fp_input_a_decimal_int #3#4#5#6#7#8#9 0 \scan_stop: } % \end{macrocode} -%\end{macro} -%\end{macro} %\end{macro} %\end{macro} %\end{macro} @@ -3013,6 +3015,10 @@ %\end{macro} %\end{macro} % +% +% +% +% %\subsection{Arithmetic for internal use} % % For the more complex functions, it is only possible to deliver @@ -3514,10 +3520,15 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\fp_sin:Nn} -%\begin{macro}{\fp_sin:cn} -%\begin{macro}{\fp_gsin:Nn} -%\begin{macro}{\fp_gsin:cn} +% +% +% +% +% +%\begin{macro}{\fp_sin:Nn, \fp_sin:cn} +%\UnitTested +%\begin{macro}{\fp_gsin:Nn,\fp_gsin:cn} +%\UnitTested %\begin{macro}[aux]{\fp_sin_aux:NNn} %\begin{macro}[aux]{\fp_sin_aux_i:} %\begin{macro}[aux]{\fp_sin_aux_ii:} @@ -3639,16 +3650,18 @@ % \end{macrocode} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} %\end{macro} %\end{macro} %\end{macro} % -%\begin{macro}{\fp_cos:Nn} -%\begin{macro}{\fp_cos:cn} -%\begin{macro}{\fp_gcos:Nn} -%\begin{macro}{\fp_gcos:cn} +% +% +% +% +%\begin{macro}{\fp_cos:Nn, \fp_cos:cn} +%\UnitTested +%\begin{macro}{\fp_gcos:Nn,\fp_gcos:cn} +%\UnitTested %\begin{macro}[aux]{\fp_cos_aux:NNn} %\begin{macro}[aux]{\fp_cos_aux_i:} %\begin{macro}[aux]{\fp_cos_aux_ii:} @@ -3759,12 +3772,14 @@ % \end{macrocode} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} %\end{macro} %\end{macro} %\end{macro} % +% +% +% +% %\begin{macro}{\fp_trig_calc_cos:} %\begin{macro}{\fp_trig_calc_sin:} %\begin{macro}[aux]{\fp_trig_calc_Taylor:} @@ -3882,10 +3897,13 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\fp_tan:Nn} -%\begin{macro}{\fp_tan:cn} -%\begin{macro}{\fp_gtan:Nn} -%\begin{macro}{\fp_gtan:cn} +% +% +% +%\begin{macro}{\fp_tan:Nn, \fp_tan:cn} +%\UnitTested +%\begin{macro}{\fp_gtan:Nn,\fp_gtan:cn} +%\UnitTested %\begin{macro}[aux]{\fp_tan_aux:NNn} %\begin{macro}[aux]{\fp_tan_aux_i:} %\begin{macro}[aux]{\fp_tan_aux_ii:} @@ -4071,31 +4089,34 @@ %\end{macro} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} +% +% +% +% +% % %\subsection{Exponent and logarithm functions} % -%\begin{macro}{\c_fp_exp_1_tl} -%\begin{macro}{\c_fp_exp_2_tl} -%\begin{macro}{\c_fp_exp_3_tl} -%\begin{macro}{\c_fp_exp_4_tl} -%\begin{macro}{\c_fp_exp_5_tl} -%\begin{macro}{\c_fp_exp_6_tl} -%\begin{macro}{\c_fp_exp_7_tl} -%\begin{macro}{\c_fp_exp_8_tl} -%\begin{macro}{\c_fp_exp_9_tl} -%\begin{macro}{\c_fp_exp_10_tl} -%\begin{macro}{\c_fp_exp_20_tl} -%\begin{macro}{\c_fp_exp_30_tl} -%\begin{macro}{\c_fp_exp_40_tl} -%\begin{macro}{\c_fp_exp_50_tl} -%\begin{macro}{\c_fp_exp_60_tl} -%\begin{macro}{\c_fp_exp_70_tl} -%\begin{macro}{\c_fp_exp_80_tl} -%\begin{macro}{\c_fp_exp_90_tl} -%\begin{macro}{\c_fp_exp_100_tl} -%\begin{macro}{\c_fp_exp_200_tl} +%\begin{macro}[aux]{\c_fp_exp_1_tl} +%\begin{macro}[aux]{\c_fp_exp_2_tl} +%\begin{macro}[aux]{\c_fp_exp_3_tl} +%\begin{macro}[aux]{\c_fp_exp_4_tl} +%\begin{macro}[aux]{\c_fp_exp_5_tl} +%\begin{macro}[aux]{\c_fp_exp_6_tl} +%\begin{macro}[aux]{\c_fp_exp_7_tl} +%\begin{macro}[aux]{\c_fp_exp_8_tl} +%\begin{macro}[aux]{\c_fp_exp_9_tl} +%\begin{macro}[aux]{\c_fp_exp_10_tl} +%\begin{macro}[aux]{\c_fp_exp_20_tl} +%\begin{macro}[aux]{\c_fp_exp_30_tl} +%\begin{macro}[aux]{\c_fp_exp_40_tl} +%\begin{macro}[aux]{\c_fp_exp_50_tl} +%\begin{macro}[aux]{\c_fp_exp_60_tl} +%\begin{macro}[aux]{\c_fp_exp_70_tl} +%\begin{macro}[aux]{\c_fp_exp_80_tl} +%\begin{macro}[aux]{\c_fp_exp_90_tl} +%\begin{macro}[aux]{\c_fp_exp_100_tl} +%\begin{macro}[aux]{\c_fp_exp_200_tl} % Calculation of exponentials requires a number of precomputed values: % first the positive integers. % \begin{macrocode} @@ -4181,26 +4202,29 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\c_fp_exp_-1_tl} -%\begin{macro}{\c_fp_exp_-2_tl} -%\begin{macro}{\c_fp_exp_-3_tl} -%\begin{macro}{\c_fp_exp_-4_tl} -%\begin{macro}{\c_fp_exp_-5_tl} -%\begin{macro}{\c_fp_exp_-6_tl} -%\begin{macro}{\c_fp_exp_-7_tl} -%\begin{macro}{\c_fp_exp_-8_tl} -%\begin{macro}{\c_fp_exp_-9_tl} -%\begin{macro}{\c_fp_exp_-10_tl} -%\begin{macro}{\c_fp_exp_-20_tl} -%\begin{macro}{\c_fp_exp_-30_tl} -%\begin{macro}{\c_fp_exp_-40_tl} -%\begin{macro}{\c_fp_exp_-50_tl} -%\begin{macro}{\c_fp_exp_-60_tl} -%\begin{macro}{\c_fp_exp_-70_tl} -%\begin{macro}{\c_fp_exp_-80_tl} -%\begin{macro}{\c_fp_exp_-90_tl} -%\begin{macro}{\c_fp_exp_-100_tl} -%\begin{macro}{\c_fp_exp_-200_tl} +% +% +% +%\begin{macro}[aux]{\c_fp_exp_-1_tl} +%\begin{macro}[aux]{\c_fp_exp_-2_tl} +%\begin{macro}[aux]{\c_fp_exp_-3_tl} +%\begin{macro}[aux]{\c_fp_exp_-4_tl} +%\begin{macro}[aux]{\c_fp_exp_-5_tl} +%\begin{macro}[aux]{\c_fp_exp_-6_tl} +%\begin{macro}[aux]{\c_fp_exp_-7_tl} +%\begin{macro}[aux]{\c_fp_exp_-8_tl} +%\begin{macro}[aux]{\c_fp_exp_-9_tl} +%\begin{macro}[aux]{\c_fp_exp_-10_tl} +%\begin{macro}[aux]{\c_fp_exp_-20_tl} +%\begin{macro}[aux]{\c_fp_exp_-30_tl} +%\begin{macro}[aux]{\c_fp_exp_-40_tl} +%\begin{macro}[aux]{\c_fp_exp_-50_tl} +%\begin{macro}[aux]{\c_fp_exp_-60_tl} +%\begin{macro}[aux]{\c_fp_exp_-70_tl} +%\begin{macro}[aux]{\c_fp_exp_-80_tl} +%\begin{macro}[aux]{\c_fp_exp_-90_tl} +%\begin{macro}[aux]{\c_fp_exp_-100_tl} +%\begin{macro}[aux]{\c_fp_exp_-200_tl} % Now the negative integers. % \begin{macrocode} \tl_new:c { c_fp_exp_-1_tl } @@ -4285,10 +4309,16 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\fp_exp:Nn} -%\begin{macro}{\fp_exp:cn} -%\begin{macro}{\fp_gexp:Nn} -%\begin{macro}{\fp_gexp:cn} +% +% +% +% +% +% +%\begin{macro}{\fp_exp:Nn, \fp_exp:cn} +%\UnitTested +%\begin{macro}{\fp_gexp:Nn,\fp_gexp:cn} +%\UnitTested %\begin{macro}[aux]{\fp_exp_aux:NNn} %\begin{macro}[aux]{\fp_exp_internal:} %\begin{macro}[aux]{\fp_exp_aux:} @@ -4684,18 +4714,18 @@ %\end{macro} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} % -%\begin{macro}{\c_fp_ln_10_1_tl} -%\begin{macro}{\c_fp_ln_10_2_tl} -%\begin{macro}{\c_fp_ln_10_3_tl} -%\begin{macro}{\c_fp_ln_10_4_tl} -%\begin{macro}{\c_fp_ln_10_5_tl} -%\begin{macro}{\c_fp_ln_10_6_tl} -%\begin{macro}{\c_fp_ln_10_7_tl} -%\begin{macro}{\c_fp_ln_10_8_tl} -%\begin{macro}{\c_fp_ln_10_9_tl} +% +% +%\begin{macro}[aux]{\c_fp_ln_10_1_tl} +%\begin{macro}[aux]{\c_fp_ln_10_2_tl} +%\begin{macro}[aux]{\c_fp_ln_10_3_tl} +%\begin{macro}[aux]{\c_fp_ln_10_4_tl} +%\begin{macro}[aux]{\c_fp_ln_10_5_tl} +%\begin{macro}[aux]{\c_fp_ln_10_6_tl} +%\begin{macro}[aux]{\c_fp_ln_10_7_tl} +%\begin{macro}[aux]{\c_fp_ln_10_8_tl} +%\begin{macro}[aux]{\c_fp_ln_10_9_tl} % Constants for working out logarithms: first those for the powers of % ten. % \begin{macrocode} @@ -4737,9 +4767,9 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\c_fp_ln_2_1_tl } -%\begin{macro}{\c_fp_ln_2_2_tl } -%\begin{macro}{\c_fp_ln_2_3_tl } +%\begin{macro}[aux]{\c_fp_ln_2_1_tl } +%\begin{macro}[aux]{\c_fp_ln_2_2_tl } +%\begin{macro}[aux]{\c_fp_ln_2_3_tl } % The smaller set for powers of two. % \begin{macrocode} \tl_new:c { c_fp_ln_2_1_tl } @@ -4756,10 +4786,13 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\fp_ln:Nn} -%\begin{macro}{\fp_ln:cn} -%\begin{macro}{\fp_gln:Nn} -%\begin{macro}{\fp_gln:cn} +% +% +% +%\begin{macro}{\fp_ln:Nn, \fp_ln:cn} +%\UnitTested +%\begin{macro}{\fp_gln:Nn,\fp_gln:cn} +%\UnitTested %\begin{macro}[aux]{\fp_ln_aux:NNn} %\begin{macro}[aux]{\fp_ln_aux:} %\begin{macro}[aux]{\fp_ln_exponent:} @@ -5237,13 +5270,13 @@ %\end{macro} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} % -%\begin{macro}{\fp_pow:Nn} -%\begin{macro}{\fp_pow:cn} -%\begin{macro}{\fp_gpow:Nn} -%\begin{macro}{\fp_gpow:cn} +% +% +%\begin{macro}{\fp_pow:Nn, \fp_pow:cn} +%\UnitTested +%\begin{macro}{\fp_gpow:Nn,\fp_gpow:cn} +%\UnitTested %\begin{macro}[aux]{\fp_pow_aux:NNn} %\begin{macro}[aux]{\fp_pow_aux_i:} %\begin{macro}[aux]{\fp_pow_positive:} @@ -5490,13 +5523,15 @@ %\end{macro} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} +% +% +% % %\subsection{Tests for special values} % %\begin{macro}{\fp_if_undefined_p:N} %\begin{macro}[TF]{\fp_if_undefined:N} +%\UnitTested % Testing for an undefined value is easy. % \begin{macrocode} \prg_new_conditional:Npnn \fp_if_undefined:N #1 { T , F , TF , p } { @@ -5510,8 +5545,12 @@ %\end{macro} %\end{macro} % +% +% +% %\begin{macro}{\fp_if_zero_p:N} %\begin{macro}[TF]{\fp_if_zero:N} +%\UnitTested % Testing for a zero fixed-point is also easy. % \begin{macrocode} \prg_new_conditional:Npnn \fp_if_zero:N #1 { T , F , TF , p } { @@ -5525,10 +5564,16 @@ %\end{macro} %\end{macro} % +% +% +% +% +% %\subsection{Floating-point conditionals} % %\begin{macro}[TF]{\fp_compare:nNn} %\begin{macro}[TF]{\fp_compare:NNN} +%\UnitTested %\begin{macro}[aux]{\fp_compare_aux:N} %\begin{macro}[aux]{\fp_compare_=:} %\begin{macro}[aux]{\fp_compare_<:} @@ -5841,4 +5886,4 @@ % %\PrintChanges % -%\PrintIndex
\ No newline at end of file +%\PrintIndex |