summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3fp-old.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3fp-old.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-old.dtx42
1 files changed, 24 insertions, 18 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-old.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-old.dtx
index b195f766d52..63895efcaae 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-old.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-old.dtx
@@ -35,8 +35,8 @@
%%
%
%<*driver>
-\RequirePackage{l3names}
-\GetIdInfo$Id: l3fp-old.dtx 3986 2012-07-15 19:23:51Z joseph $
+\RequirePackage{l3bootstrap}
+\GetIdInfo$Id: l3fp-old.dtx 4082 2012-08-12 12:14:17Z bruno $
{L3 Experimental floating-points (old)}
\documentclass[full]{l3doc}
\begin{document}
@@ -120,11 +120,17 @@
% \fp_abs:N , \fp_abs:c , \fp_gabs:N , \fp_gabs:c ,
% \fp_neg:N , \fp_neg:c , \fp_gneg:N , \fp_gneg:c ,
% }
+% \begin{macro}[aux]{\@@_abs:NNN}
+% Simply expand the floating point variable to feed it to
+% \cs{@@_abs_o:w} or \cs{@@_neg_o:w}, expanded within an expanding
+% token list assignment. The \cs{prg_do_nothing:} is not necessary,
+% but it reminds us moe clearly that \cs{@@_abs_o:w} and
+% \cs{@@_neg_o:w} expand after their result.
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \fp_abs:N { \@@_abs:NNN \tl_set:Nx \@@_abs:w }
-\cs_new_protected_nopar:Npn \fp_gabs:N { \@@_abs:NNN \tl_gset:Nx \@@_abs:w }
-\cs_new_protected_nopar:Npn \fp_neg:N { \@@_abs:NNN \tl_set:Nx \@@_neg:w }
-\cs_new_protected_nopar:Npn \fp_gneg:N { \@@_abs:NNN \tl_gset:Nx \@@_neg:w }
+\cs_new_protected_nopar:Npn \fp_abs:N { \@@_abs:NNN \tl_set:Nx \@@_abs_o:w }
+\cs_new_protected_nopar:Npn \fp_gabs:N { \@@_abs:NNN \tl_gset:Nx \@@_abs_o:w }
+\cs_new_protected_nopar:Npn \fp_neg:N { \@@_abs:NNN \tl_set:Nx \@@_neg_o:w }
+\cs_new_protected_nopar:Npn \fp_gneg:N { \@@_abs:NNN \tl_gset:Nx \@@_neg_o:w }
\cs_new_protected:Npn \@@_abs:NNN #1#2#3
{ #1 #3 { \exp_after:wN #2 #3 \prg_do_nothing: } }
\cs_generate_variant:Nn \fp_abs:N { c }
@@ -133,6 +139,7 @@
\cs_generate_variant:Nn \fp_gneg:N { c }
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}
% {
@@ -149,7 +156,8 @@
\cs_new_protected_nopar:Npn \fp_gdiv:Nn { \@@_mul:NNNn \fp_gset:Nn / }
\cs_new_protected_nopar:Npn \fp_pow:Nn { \@@_mul:NNNn \fp_set:Nn ^ }
\cs_new_protected_nopar:Npn \fp_gpow:Nn { \@@_mul:NNNn \fp_gset:Nn ^ }
-\cs_new_protected:Npn \@@_mul:NNNn #1#2#3#4 { #1 #3 { #3 #2 (#4) } }
+\cs_new_protected:Npn \@@_mul:NNNn #1#2#3#4
+ { #1 #3 { #3 #2 \@@_parse:n {#4} } }
\cs_generate_variant:Nn \fp_mul:Nn { c }
\cs_generate_variant:Nn \fp_gmul:Nn { c }
\cs_generate_variant:Nn \fp_div:Nn { c }
@@ -170,9 +178,8 @@
% }
% \begin{macro}[aux]
% {\@@_assign_to:nNNNn, \@@_assign_to_i:wNNNn, \@@_assign_to_ii:NnNNN}
-% Here, an added twist
-% is that each value computed by these expensive unary operations is
-% stored as a constant floating point number.
+% Here, an added twist is that each value computed by these expensive
+% unary operations is stored as a constant floating point number.
% \begin{macrocode}
\cs_set_protected:Npn \@@_tmp:w #1#2#3#4#5
{
@@ -181,11 +188,11 @@
\cs_generate_variant:Nn #1 { c }
\cs_generate_variant:Nn #2 { c }
}
-\@@_tmp:w \fp_exp:Nn \fp_gexp:Nn \@@_exp:w {exp} \@@_assign_to:nNNNn
-\@@_tmp:w \fp_ln:Nn \fp_gln:Nn \@@_ln:w {ln } \@@_assign_to:nNNNn
-\@@_tmp:w \fp_sin:Nn \fp_gsin:Nn \@@_sin:w {sin} \@@_assign_to:nNNNn
-\@@_tmp:w \fp_cos:Nn \fp_gcos:Nn \@@_cos:w {cos} \@@_assign_to:nNNNn
-\@@_tmp:w \fp_tan:Nn \fp_gtan:Nn \@@_tan:w {tan} \@@_assign_to:nNNNn
+\@@_tmp:w \fp_exp:Nn \fp_gexp:Nn \@@_exp_o:w {exp} \@@_assign_to:nNNNn
+\@@_tmp:w \fp_ln:Nn \fp_gln:Nn \@@_ln_o:w {ln } \@@_assign_to:nNNNn
+\@@_tmp:w \fp_sin:Nn \fp_gsin:Nn \@@_sin_o:w {sin} \@@_assign_to:nNNNn
+\@@_tmp:w \fp_cos:Nn \fp_gcos:Nn \@@_cos_o:w {cos} \@@_assign_to:nNNNn
+\@@_tmp:w \fp_tan:Nn \fp_gtan:Nn \@@_tan_o:w {tan} \@@_assign_to:nNNNn
\cs_new_protected:Npn \@@_assign_to:nNNNn #1#2#3#4#5
{
\exp_after:wN \@@_assign_to_i:wNNNn
@@ -194,7 +201,7 @@
\cs_new_protected:Npn \@@_assign_to_i:wNNNn \s_@@ \@@_chk:w #1#2#3; #4
{
\exp_args:Nc \@@_assign_to_ii:NnNNN
- { c_@@_ #4 ( #2 \if_meaning:w 1 #1 #3 \fi: ) _fp }
+ { c_@@_ #4 [ #1 # 2 \if_meaning:w 1 #1 #3 \fi: ] _fp }
{ #1#2#3 }
}
\cs_new_protected:Npn \@@_assign_to_ii:NnNNN #1#2#3#4#5
@@ -207,14 +214,13 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}[pTF, EXP]{\fp_compare:NNN}
+% \begin{macro}[TF]{\fp_compare:NNN}
% Comparisons used to be easier between floating points stored in
% variables. No more.
% \begin{macrocode}
\cs_new_protected_nopar:Npn \fp_compare:NNNTF { \fp_compare:nNnTF }
\cs_new_protected_nopar:Npn \fp_compare:NNNT { \fp_compare:nNnT }
\cs_new_protected_nopar:Npn \fp_compare:NNNF { \fp_compare:nNnF }
-\cs_new_protected_nopar:Npn \fp_compare_p:NNN { \fp_compare_p:nNn }
% \end{macrocode}
% \end{macro}
%