diff options
author | Karl Berry <karl@freefriends.org> | 2017-03-19 22:13:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-03-19 22:13:10 +0000 |
commit | a9b5c8812a42ed9fc7bd6323b1185a096ecb7c0e (patch) | |
tree | 3130ecf7e791b7a7bf9587e8d8d3a339921de401 /Master/texmf-dist/source/latex | |
parent | dd8d54441efc71090eb7f91c1315b3d08ddbdcdc (diff) |
l3 (19mar17)
git-svn-id: svn://tug.org/texlive/trunk@43548 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
60 files changed, 972 insertions, 1203 deletions
diff --git a/Master/texmf-dist/source/latex/l3build/l3build.dtx b/Master/texmf-dist/source/latex/l3build/l3build.dtx index 1c57945c9cc..2d5a2f5a4e2 100644 --- a/Master/texmf-dist/source/latex/l3build/l3build.dtx +++ b/Master/texmf-dist/source/latex/l3build/l3build.dtx @@ -22,10 +22,8 @@ % %<*driver> \RequirePackage{expl3} -\def\ExplFileName{l3build} -\def\ExplFileDescription{L3 Regression test suite} -\def\ExplFileDate{2017/03/07} -\def\ExplFileVersion{6984} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \documentclass[full]{l3doc} \renewcommand\partname{Part} \usepackage{multicol,needspace} @@ -1018,8 +1016,8 @@ % \cs{ProvidesExplFile} identifiers (at the start of a line). % \item |filename| --- Searches for lines using |\def\filename|, % |\def\filedate|, \dots, formulation. -% \item |ExplFileName| --- Searches for lines using |\def\ExplFileName|, -% |\def\ExplFileDate|, \dots, formulation. +% \item |ExplFileDate| --- Searches for lines using |\def\ExplFileDate|, +% \dots, formulation. % \end{itemize} % % For more complex cases, the programmer may directly define the diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx index 95a3dd3f067..f3b5e32d4f8 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx @@ -23,8 +23,8 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2017/03/11] -%<package>\@ifpackagelater{expl3}{2017/03/11} +\RequirePackage{expl3}[2017/03/18] +%<package>\@ifpackagelater{expl3}{2017/03/18} %<package> {} %<package> {% %<package> \PackageError{l3regex}{Support package l3kernel too old} @@ -36,8 +36,8 @@ %<package> }% %<package> \endinput %<package> } -\GetIdInfo$Id: l3regex.dtx 6988 2017-03-11 15:52:21Z joseph $ - {L3 Experimental regular expressions} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -738,8 +738,8 @@ % % \begin{macrocode} %<*package> -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\ProvidesExplPackage{l3regex}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental regular expressions} \RequirePackage{l3tl-build, l3tl-analysis, l3str-convert} %</package> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx index ad0dad50e0d..5d597da8456 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx @@ -22,8 +22,8 @@ % %<*driver|package> \RequirePackage{expl3} -\GetIdInfo$Id: l3str-convert.dtx 6969 2017-02-20 18:32:23Z bruno $ - {L3 Experimental string encoding conversions} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -276,8 +276,8 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\ProvidesExplPackage{l3str-convert}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental string encoding conversions} \RequirePackage{l3tl-analysis,l3tl-build} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx index 4244d7ae570..f17f9ad3488 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3str-format.dtx Copyright (C) 2012-2013,2015,2016 The LaTeX3 Project +%% File: l3str-format.dtx Copyright (C) 2012-2013,2015-2017 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 @@ -22,8 +22,8 @@ % %<*driver|package> \RequirePackage{expl3} -\GetIdInfo$Id: l3str-format.dtx 6948 2017-02-18 14:50:25Z bruno $ - {L3 Experimental string formatting} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -167,8 +167,8 @@ % % \begin{macrocode} %<*package> -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\ProvidesExplPackage{l3str-format}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental string formatting} \RequirePackage{l3str} %</package> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx index f08009cbb24..bd48715f3a2 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3tl-analysis.dtx Copyright (C) 2011-2012,2015,2016 The LaTeX3 Project +%% File: l3tl-analysis.dtx Copyright (C) 2011-2012,2015-2017 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 @@ -22,8 +22,8 @@ % %<*driver|package> \RequirePackage{expl3} -\GetIdInfo$Id: l3tl-analysis.dtx 6948 2017-02-18 14:50:25Z bruno $ - {L3 Experimental token lists analysis} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -175,8 +175,8 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\ProvidesExplPackage{l3tl-analysis}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental token list analysis} % \end{macrocode} % % \subsection{Variables and helper functions} diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-build.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-build.dtx index fe8e4348b45..f3667c244e9 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-build.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-build.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3tl-build.dtx Copyright (C) 2011-2016 The LaTeX3 Project +%% File: l3tl-build.dtx Copyright (C) 2011-2017 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 @@ -23,8 +23,8 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2017/03/11] -%<package>\@ifpackagelater{expl3}{2017/03/11} +\RequirePackage{expl3}[2017/03/18] +%<package>\@ifpackagelater{expl3}{2017/03/18} %<package> {} %<package> {% %<package> \PackageError{l3tl-build}{Support package l3kernel too old} @@ -36,8 +36,8 @@ %<package> }% %<package> \endinput %<package> } -\GetIdInfo$Id: l3tl-build.dtx 6988 2017-03-11 15:52:21Z joseph $ - {L3 Experimental token list construction} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -154,8 +154,8 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\ProvidesExplPackage{l3tl-build}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental token list construction} % \end{macrocode} % % \subsection{Variables and helper functions} diff --git a/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx b/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx index 116912675d2..8524f10d744 100644 --- a/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx @@ -22,8 +22,8 @@ % %<*driver|package> \RequirePackage{xparse} -\GetIdInfo$Id: xcoffins.dtx 6833 2017-01-28 20:01:31Z joseph $ - {L3 Experimental design-level coffins} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -681,8 +681,8 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\ProvidesExplPackage{xcoffins}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental design level coffins} % \end{macrocode} % % \begin{variable} diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx index 7cf270aaf36..7c386fb74f0 100644 --- a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx @@ -24,8 +24,8 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2017/03/11] -%<package>\@ifpackagelater{expl3}{2017/03/11} +\RequirePackage{expl3}[2017/03/18] +%<package>\@ifpackagelater{expl3}{2017/03/18} %<package> {} %<package> {% %<package> \PackageError{l3galley}{Support package l3kernel too old} @@ -37,8 +37,8 @@ %<package> }% %<package> \endinput %<package> } -\GetIdInfo$Id: l3galley.dtx 6988 2017-03-11 15:52:21Z joseph $ - {L3 Experimental galley code} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -690,8 +690,8 @@ % % \begin{macrocode} %<*package> -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\ProvidesExplPackage{l3galley}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental galley code} %</package> % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx index 290c64bc8b8..521adb1604d 100644 --- a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx @@ -23,8 +23,8 @@ % %<*driver|package> \RequirePackage{xparse} -\GetIdInfo$Id: xgalley.dtx 6963 2017-02-20 02:29:02Z bruno $ - {L3 Experimental galley} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -736,8 +736,8 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\ProvidesExplPackage{xgalley}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental galley} \RequirePackage{xparse,xtemplate,l3galley} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx index 99dea9f36ef..f774a341445 100644 --- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx @@ -21,10 +21,8 @@ % for those people who are interested. % %<*driver|generic|package> -\def\ExplFileName{expl3}% -\def\ExplFileDescription{L3 programming layer}% -\def\ExplFileDate{2017/03/11}% -\def\ExplFileVersion{6988}% +\def\ExplFileDate{2017/03/18}% +\def\ExplFileVersion{7019}% %</driver|generic|package> %<*driver> \documentclass[full]{l3doc} @@ -990,7 +988,7 @@ % \begin{itemize} % \item \pdfTeX{} v1.40 or later. % \item \XeTeX{} v0.9994 or later. -% \item \LuaTeX{} v0.40 or later. +% \item \LuaTeX{} v0.70 or later. % \item e-(u)p\TeX{} mid-2012 or later. % \end{itemize} % @@ -1133,11 +1131,11 @@ % \begin{macrocode} %<*!loader> \begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname ver@\ExplFileName -code.tex\endcsname\relax - \expandafter\edef\csname ver@\ExplFileName -code.tex\endcsname +\expandafter\ifx\csname ver@expl3-code.tex\endcsname\relax + \expandafter\edef\csname ver@expl3-code.tex\endcsname {% \ExplFileDate\space v\ExplFileVersion\space - \ExplFileDescription\space + L3 programming layer }% \else \expandafter\endinput @@ -1153,10 +1151,9 @@ %<*!loader> \immediate\write-1 % {% - Package: - \ExplFileName\space - \ExplFileDate\space v\ExplFileVersion\space \ExplFileDescription\space - (code)% + Package: expl3 + \ExplFileDate\space v\ExplFileVersion\space + L3 programming layer (code)% }% %</!loader> % \end{macrocode} @@ -1169,10 +1166,10 @@ % % Identify the package. % \begin{macrocode} -\ProvidesPackage{\ExplFileName} +\ProvidesPackage{expl3} [% \ExplFileDate\space v\ExplFileVersion\space - \ExplFileDescription\space (loader) + L3 programming layer (loader) ]% % \end{macrocode} % @@ -1258,11 +1255,6 @@ \fi % \end{macrocode} % -% Deactivate writing module information to the log. -% \begin{macrocode} -\protected\def\GetIdInfoLog{} -% \end{macrocode} -% % \begin{macro}{\color} % The \cs{color} macro must be defined for showing coffin poles, so % a no-op version is provided here. @@ -1603,22 +1595,22 @@ % no \LaTeXe{} mechanism so this is all pretty basic. % \begin{macrocode} \begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname ver@\ExplFileName -generic.tex\endcsname\relax +\expandafter\ifx\csname ver@expl3-generic.tex\endcsname\relax \else \immediate\write-1 {% - Package \ExplFileName\space Info: The package is already loaded.% + Package expl3 Info: The package is already loaded.% }% \expandafter\endinput \fi \immediate\write-1 {% - Package: \ExplFileName\space + Package: expl3 \ExplFileDate\space v\ExplFileVersion\space - \ExplFileDescription\space (loader)% + L3 programming layer (loader)% }% -\expandafter\edef\csname ver@\ExplFileName -generic.tex\endcsname - {\ExplFileDate\space v\ExplFileVersion\space \ExplFileDescription}% +\expandafter\edef\csname ver@expl3-generic.tex\endcsname + {\ExplFileDate\space v\ExplFileVersion\space L3 programming layer}% % \end{macrocode} % % \begin{variable}[aux]{\l@expl@tidy@tl} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx index 2a788cf80d2..3b667829d94 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx @@ -22,8 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3alloc.dtx 6952 2017-02-18 19:07:47Z joseph $ - {L3 Register allocation} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -163,7 +163,7 @@ % \end{macro} % % \begin{macro}[int]{\@@_reg:nNNN} -% The allocator itself is modeled somewhat on \LaTeXe{}'s \tn{e@alloc}, +% The allocator itself is modelled somewhat on \LaTeXe{}'s \tn{e@alloc}, % though there is no need to set \tn{allocationnumber}. % \begin{macrocode} \cs_new_protected:Npn \@@_reg:nNnN #1#2#3#4 diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx index 6b66f76f239..7a8ed8ad42a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3basics.dtx 6929 2017-02-14 15:53:00Z bruno $ - {L3 Basic definitions} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx index 0d9512296ff..0f1579b47bc 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3bootstrap.dtx Copyright (C) 2011-2016 The LaTeX3 project +%% File: l3bootstrap.dtx Copyright (C) 2011-2017 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 @@ -23,7 +23,6 @@ %<*driver|package> % \begin{macro}{\GetIdInfo} % \begin{macro}[aux]{\GetIdInfoAuxI, \GetIdInfoAuxII, \GetIdInfoAuxIII} -% \begin{macro}[int]{\GetIdInfoLog} % The idea here is to extract out the information needed from a standard % \textsc{svn} \texttt{Id} line, but without a line that will get % changed when the file is checked in. Hence the fact that there is @@ -76,7 +75,6 @@ }% \fi \tempa - \GetIdInfoLog }% % \end{macrocode} % Here, |#1| is |Id|, |#2| is the file name, |#3| is the extension, @@ -114,28 +112,15 @@ {% \def\ExplFileDate{#1/#2/#3}% }% -% \end{macrocode} -% During loading of \pkg{expl3}, module information is added to the log. -% This function gets redefined once loading is complete. -% \begin{macrocode} - \csname protected\endcsname\gdef\GetIdInfoLog - {% - \immediate\write-1 % - {% - L3 Module: - \ExplFileName\space - \ExplFileDate\space v\ExplFileVersion\space \ExplFileDescription - }% - }% \endgroup % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} -\GetIdInfo$Id: l3bootstrap.dtx 6805 2016-12-28 22:15:52Z joseph $ - {L3 Bootstrap code}% %</driver|package> %<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \documentclass[full]{l3doc} \begin{document} \DocInput{\jobname.dtx} @@ -405,7 +390,7 @@ \fi \expandafter\ifx\csname directlua\endcsname\relax \else - \ifnum\luatexversion<40 \else 1\fi + \ifnum\luatexversion<70 \else 1\fi \fi =0 % \newlinechar`\^^J % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx index 0b06dae64f2..cfd6696efb5 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3box.dtx Copyright (C) 2005-2016 The LaTeX3 Project +%% File: l3box.dtx Copyright (C) 2005-2017 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 @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3box.dtx 6943 2017-02-17 16:47:59Z bruno $ - {L3 Experimental boxes} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index 526762d2529..44d51219ddd 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3candidates.dtx 6967 2017-02-20 14:51:30Z bruno $ - {L3 Experimental additions to l3kernel} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx index f85046e2a98..8ca02a71ddf 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx @@ -24,12 +24,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3clist.dtx 6967 2017-02-20 14:51:30Z bruno $ - {L3 Comma separated lists} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx index 2cdab0d37ad..43c6f6d026e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3coffins.dtx 6906 2017-02-12 20:07:58Z bruno $ - {L3 Coffin code layer} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx b/Master/texmf-dist/source/latex/l3kernel/l3color.dtx index 4512d174154..2b7e541218b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3color.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3color.dtx Copyright(C) 2011,2012,2014,2016 The LaTeX3 Project +%% File: l3color.dtx Copyright(C) 2011,2012,2014,2016,2017 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 @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3color.dtx 6805 2016-12-28 22:15:52Z joseph $ - {L3 Experimental color support} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx index 01c880e3d50..5dcb5dd4b67 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3deprecation.dtx 6966 2017-02-20 03:39:43Z bruno $ - {L3 Deprecation errors} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -138,6 +134,10 @@ % testing code even if it relies on other packages: load all other % packages, call \cs{deprecation_error:}, and load the code that one is % interested in testing. +% +% One of the deprecated syntaxes is within floating point expressions; +% to keep related code in the same place we define in \pkg{l3fp-parse} +% a version of \cs{__fp_parse_round:Nw} producing an error. % \begin{macrocode} \cs_new_protected:Npn \deprecation_error: { @@ -147,6 +147,7 @@ \@@_error:Nnn \c_minus_one { - 1 } { 2018-12-31 } \@@_error:Nnn \sort_ordered: { \sort_return_same: } { 2018-12-31 } \@@_error:Nnn \sort_reversed: { \sort_return_swapped: } { 2018-12-31 } + \cs_set_eq:NN \__fp_parse_round:Nw \__fp_parse_round_deprecation_error:Nw \cs_set_eq:NN \deprecation_error: \scan_stop: } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx index 73c126ed443..f98ce0a333d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3doc.dtx Copyright (C) 1990-2016 The LaTeX3 project +%% File: l3doc.dtx Copyright (C) 1990-2017 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 @@ -54,21 +54,20 @@ Do not distribute a modified version of this file. % Need to protect the file metadata for any modules that load % \cls{l3doc}. This is restored after \cs{ProvideExplClass} below. % \begin{macrocode} -%<class>\let \filenameOld \ExplFileName %<class>\let \filedateOld \ExplFileDate %<class>\let \fileversionOld \ExplFileVersion -%<class>\let \filedescriptionOld \ExplFileDescription % \end{macrocode} % %<*driver|class> \RequirePackage{expl3,xparse,calc} -\GetIdInfo$Id: l3doc.dtx 6943 2017-02-17 16:47:59Z bruno $ - {L3 Experimental documentation class} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|class> % %<*driver> -\ProvidesFile{\ExplFileName.dtx} - [\ExplFileDate\space v\ExplFileVersion\space\ExplFileDescription] +\ProvidesFile{l3doc.dtx} + [\ExplFileDate\space v\ExplFileVersion\space + L3 Experimental documentation class] \documentclass{l3doc} \usepackage{framed,lipsum} \begin{document} @@ -79,12 +78,10 @@ Do not distribute a modified version of this file. % This isn't included in the typeset documentation because it's a bit % ugly: %<*class> -\ProvidesExplClass - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\let \ExplFileName \filenameOld +\ProvidesExplClass{l3doc}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental documentation class} \let \ExplFileDate \filedateOld \let \ExplFileVersion \fileversionOld -\let \ExplFileDescription \filedescriptionOld %</class> % \fi % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx index 7b98fe3889a..2ed2f7c2de8 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx @@ -1,6 +1,6 @@ % \iffalse % -%% File l3dosctrip.dtx Copyright (C) 2012,2016 The LaTeX3 Project +%% File l3dosctrip.dtx Copyright (C) 2012,2016,2017 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 @@ -21,9 +21,8 @@ % for those people who are interested. % %<*driver|program> -\def\ExplFileDate{2012/06/08} -\def\ExplFileName{l3docstrip} -\def\ExplFileVersion{3787} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|program> %<*driver> % The same approach as used in \textsf{DocStrip}: if \cs{documentclass} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx b/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx index ca45f93242b..e68d0b5b059 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx @@ -24,8 +24,8 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3drivers.dtx 6954 2017-02-18 20:26:11Z joseph $ - {L3 Experimental drivers} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|package> %<*driver> \begin{document} @@ -626,7 +626,7 @@ % \subsubsection{Basics} % % \begin{macro}[int]{\@@_literal:n} -% Equivalent to \texttt{pdf:content} but favoured as the link to +% Equivalent to \texttt{pdf:content} but favored as the link to % the \pdfTeX{} primitive approach is clearer. % \begin{macrocode} \cs_new_protected:Npn \@@_literal:n #1 @@ -1321,7 +1321,7 @@ % % \begin{macro}[aux]{\@@_draw_literal:n, \@@_draw_literal:x} % Literals with no positioning (using |ps:| each one is positioned but -% cut of from everything else, so no good for the stepwise approach needed +% cut off from everything else, so no good for the stepwise approach needed % here). % \begin{macrocode} \cs_new_protected:Npn \@@_draw_literal:n #1 @@ -1781,7 +1781,7 @@ % % \begin{macro}[int]{\@@_scope_begin:n} % In SVG transformations, clips and so on are attached directly to scopes so -% we need a way or allowing for that. This is rather more useful that +% we need a way or allowing for that. This is rather more useful than % \cs{@@_scope_begin:} as a result. No assumptions are made about the nature % of the scoped operation(s). % \begin{macrocode} @@ -1990,7 +1990,7 @@ \l_@@_draw_scope_int \g_@@_draw_scope_int \group_begin: - \int_gset:Nn \g_@@_draw_scope_int { 0 } + \int_gzero:N \g_@@_draw_scope_int } \cs_new_protected:Npn \@@_draw_scope_end: { diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx index db0cfc7e94a..9697c45991b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3expan.dtx Copyright (C) 1990-2016 The LaTeX3 project +%% File: l3expan.dtx Copyright (C) 1990-2017 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 @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3expan.dtx 6967 2017-02-20 14:51:30Z bruno $ - {L3 Argument expansion} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx index 6ea0556fab4..4a81599e6e0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3file.dtx 6964 2017-02-20 02:59:41Z bruno $ - {L3 File and I/O operations} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx index 40b9cbe27df..6af842fa2b1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3final.dtx Copyright (C) 1990-2016 The LaTeX3 Project +%% File: l3final.dtx Copyright (C) 1990-2017 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 @@ -22,8 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3final.dtx 6805 2016-12-28 22:15:52Z joseph $ - {L3 Experimental format finalisation} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx index 5afe7e646a7..6427eb35a69 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3flag.dtx 6969 2017-02-20 18:32:23Z bruno $ - {L3 Flags} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx index 71433549d51..dcf646184e6 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx @@ -22,8 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-assign.dtx 6906 2017-02-12 20:07:58Z bruno $ - {L3 Floating-point assignments} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -203,7 +203,7 @@ % \end{variable} % % \begin{variable}{\c_pi_fp, \c_one_degree_fp} -% We simply round $\pi$ to the closest multiple of $10^{-15}$. +% We simply round $\pi$ to and $\pi/180$ to $16$ significant digits. % \begin{macrocode} \fp_const:Nn \c_pi_fp { 3.141 5926 5358 9793 } \fp_const:Nn \c_one_degree_fp { 0.0 1745 3292 5199 4330 } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx index de3bae56fd4..8d2a67dc46e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx @@ -22,9 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-aux.dtx 6968 2017-02-20 16:08:44Z bruno $ - {L3 Floating-point support functions} -\documentclass[full]{l3doc} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -68,7 +67,6 @@ % % ^^A todo: make sanitize and pack more homogeneous between modules. % -% ^^A begin[todo]: move % \subsection{Internal representation} % % Internally, a floating point number \meta{X} is a @@ -79,25 +77,21 @@ % Let us explain each piece separately. % % Internal floating point numbers will be used in expressions, -% and in this context will be subject to f-expansion. They must +% and in this context will be subject to \texttt{f}-expansion. They must % leave a recognizable mark after \texttt{f}-expansion, to prevent the % floating point number from being re-parsed. Thus, \cs{s_@@} % is simply another name for \tn{relax}. % -% Since floating point numbers are always accessed by the various -% operations using f-expansion, we can safely let them be protected: -% \texttt{x}-expansion will then leave them untouched. However, when -% used directly without an accessor function, floating points should -% produce an error. \cs{s_@@} will do nothing, and \cs{@@_chk:w} -% produces an error. -% -% The (decimal part of the) IEEE-754-2008 standard requires the -% format to be able to represent special floating point numbers -% besides the usual positive and negative cases. The various -% possibilities will be distinguished by their \meta{case}, which -% is a single digit:\footnote{Bruno: I need to implement subnormal -% numbers. Also, quiet and signalling \texttt{nan} must be better -% distinguished.} +% When used directly without an accessor function, floating points +% should produce an error: this is the role of \cs{@@_chk:w}. We could +% make floating point variables be protected to prevent them from +% expanding under \texttt{x}-expansion, but it seems more convenient to +% treat them as a subcase of token list variables. +% +% The (decimal part of the) IEEE-754-2008 standard requires the format +% to be able to represent special floating point numbers besides the +% usual positive and negative cases. We distinguish the various +% possibilities by their \meta{case}, which is a single digit: % \begin{itemize} % \item[0] zeros: |+0| and |-0|, % \item[1] \enquote{normal} numbers (positive and negative), @@ -121,19 +115,16 @@ % \cs{s_@@} \cs{@@_chk:w} 1 \meta{sign} \Arg{exponent} % \Arg{X_1} \Arg{X_2} \Arg{X_3} \Arg{X_4} |;| % \end{quote} -% Here, the \meta{exponent} is an integer, at most -% $\cs{c_@@_max_exponent_int} = -% \the\csname\detokenize{c__fp_max_exponent_int}\endcsname$ -% in absolute value. The body consists in four -% blocks of exactly $4$ digits, $ 0000 \leq \meta{X_i} \leq 9999$, -% such that +% Here, the \meta{exponent} is an integer, between +% $-\ExplSyntaxOn\int_use:N\c__fp_minus_min_exponent_int$ and +% $\ExplSyntaxOn\int_use:N\c__fp_max_exponent_int$. The body consists +% in four blocks of exactly $4$ digits, +% $0000 \leq \meta{X_i} \leq 9999$, and the floating point is % \[ -% \meta{X} -% = (-1)^{\meta{sign}} 10^{-\meta{exponent}} -% \sum_{i=1}^{4} \meta{X_i} 10^{-4i} +% (-1)^{\meta{sign}/2} \meta{X_1}\meta{X_2}\meta{X_3}\meta{X_4}\cdot 10^{\meta{exponent}-16} % \] -% and such that the \meta{exponent} is minimal. This implies -% $ 1000 \leq \meta{X_1} \leq 9999 $. +% where we have concatenated the $16$ digits. Currently, floating point numbers are normalized such that +% the \meta{exponent} is minimal, in other words, $1000 \leq \meta{X_1} \leq 9999$. % % \begin{table}\centering % \caption{Internal representation of floating point numbers.} @@ -156,30 +147,7 @@ % \end{tabular} % \end{table} % -% \subsection{Internal storage of floating points numbers} -% -% A floating point number \meta{X} is stored as -% \begin{quote} -% \cs{s_@@} \cs{@@_chk:w} \meta{case} \meta{sign} \meta{body} |;| -% \end{quote} -% Here, \meta{case} is 0 for $\pm 0$, 1 for normal numbers, 2 for $\pm -% \infty$, and 3 for \texttt{nan}, and \meta{sign} is $0$ for positive -% numbers, $1$ for \texttt{nan}s, and $2$ for negative numbers. The -% \meta{body} of normal numbers is \Arg{exponent} \Arg{X_1} \Arg{X_2} -% \Arg{X_3} \Arg{X_4}, with -% \[ -% \meta{X} = (-1)^{\meta{sign}} 10^{-\meta{exponent}} \sum_i -% \meta{X_i} 10^{-4i}. -% \] -% Calculations are done in base $10000$, \emph{i.e.} one myriad. The -% \meta{exponent} lies between $\pm\cs{c_@@_max_exponent_int} = \pm -% \the\csname\detokenize{c__fp_max_exponent_int}\endcsname$ inclusive. -% -% Additionally, positive and negative floating point numbers may only be -% stored with $1000\leq\meta{X_1}<10000$. This requirement is necessary -% in order to preserve accuracy and speed. -% -% ^^A end[todo] +% Calculations are done in base $10000$, \emph{i.e.} one myriad. % % \subsection{Using arguments and semicolons} % @@ -212,7 +180,6 @@ % \end{macrocode} % \end{macro} % -% ^^A todo: rename to \@@_args_swap:Nww % \begin{macro}[int, EXP]{\@@_reverse_args:Nww} % Many internal functions take arguments delimited by semicolons, and % it is occasionally useful to swap two such arguments. @@ -223,7 +190,7 @@ % % \begin{macro}[int, EXP]{\@@_rrot:www} % Rotate three arguments delimited by semicolons. This is the inverse -% (or the square) of the Forth primitive |ROT|. +% (or the square) of the Forth primitive |ROT|, hence the name. % \begin{macrocode} \cs_new:Npn \@@_rrot:www #1; #2; #3; { #2; #3; #1; } % \end{macrocode} @@ -284,14 +251,7 @@ % % \begin{variable} % {\c_zero_fp, \c_minus_zero_fp, \c_inf_fp, \c_minus_inf_fp, \c_nan_fp} -% The special floating points. All of them have the form -% \begin{quote} -% \cs{s_@@} \cs{@@_chk:w} \meta{case} \meta{sign} \cs[no-index]{s_@@_\ldots} |;| -% \end{quote} -% where the dots in \cs[no-index]{s_@@_\ldots} are one of \texttt{invalid}, -% \texttt{underflow}, \texttt{overflow}, \texttt{division}, -% \texttt{exact}, describing how the floating point was created. We -% define the floating points here as \enquote{exact}. +% The special floating points. We define the floating points here as \enquote{exact}. % \begin{macrocode} \tl_const:Nn \c_zero_fp { \s_@@ \@@_chk:w 0 0 \s_@@_exact ; } \tl_const:Nn \c_minus_zero_fp { \s_@@ \@@_chk:w 0 2 \s_@@_exact ; } @@ -317,20 +277,15 @@ % \end{macrocode} % \end{variable} % -% \begin{variable}[int]{\c_@@_max_exponent_int} -% Normal floating point numbers have an exponent at most -% \texttt{max_exponent} in absolute value. Larger numbers are rounded -% to $\pm\infty$. Smaller numbers are subnormal (not implemented yet), -% and digits beyond -% $10^{-\text{\texttt{max_exponent}}}$ are rounded away, hence the -% true minimum exponent is $-\text{\texttt{max_exponent}}-16$; -% beyond this, numbers are rounded to zero. Why this choice of -% limits? When computing $(a\cdot 10^n)^(b\cdot 10^p)$, we need to -% evaluate $\log(a\cdot 10^n) = \log(a) + n \log(10)$ as a fixed point -% number, which we manipulate as blocks of $4$ digits. Multiplying -% such a fixed point number by $n<10000$ is much cheaper than larger -% $n$, because we can multiply $n$ with each block safely. +% \begin{variable}[int]{\c_@@_minus_min_exponent_int, \c_@@_max_exponent_int} +% Normal floating point numbers have an exponent between $-$ +% \texttt{minus_min_exponent} and \texttt{max_exponent} inclusive. +% Larger numbers are rounded to $\pm\infty$. Smaller numbers are +% rounded to $\pm 0$. It would be more natural to define a +% \texttt{min_exponent} with the opposite sign but that would waste +% one \TeX{} count. % \begin{macrocode} +\int_const:Nn \c_@@_minus_min_exponent_int { 10000 } \int_const:Nn \c_@@_max_exponent_int { 10000 } % \end{macrocode} % \end{variable} @@ -343,6 +298,20 @@ % \end{macrocode} % \end{variable} % +% \begin{variable}{\c_@@_overflowing_fp} +% A floating point number that is bigger than all normal floating +% point numbers. This replaces infinities when converting to formats +% that do not support infinities. +% \begin{macrocode} +\tl_const:Nx \c_@@_overflowing_fp + { + \s_@@ \@@_chk:w 1 0 + { \int_eval:n { \c_@@_max_exponent_int + 1 } } + {1000} {0000} {0000} {0000} ; + } +% \end{macrocode} +% \end{variable} +% % \begin{macro}[int, EXP]{\@@_zero_fp:N, \@@_inf_fp:N} % In case of overflow or underflow, we have to output % a zero or infinity with a given sign. @@ -354,29 +323,9 @@ % \end{macrocode} % \end{macro} % -%^^A todo: currently unused. -% \begin{macro}[int, EXP]{\@@_max_fp:N, \@@_min_fp:N} -% In some cases, we need to output the smallest or biggest positive or -% negative finite numbers. -% \begin{macrocode} -\cs_new:Npn \@@_min_fp:N #1 - { - \s_@@ \@@_chk:w 1 #1 - { \int_eval:n { - \c_@@_max_exponent_int } } - {1000} {0000} {0000} {0000} ; - } -\cs_new:Npn \@@_max_fp:N #1 - { - \s_@@ \@@_chk:w 1 #1 - { \int_use:N \c_@@_max_exponent_int } - {9999} {9999} {9999} {9999} ; - } -% \end{macrocode} -% \end{macro} -% % \begin{macro}[int, EXP]{\@@_exponent:w} % For normal numbers, the function expands to the exponent, otherwise -% to $0$. +% to $0$. This is used in \pkg{l3str-format}. % \begin{macrocode} \cs_new:Npn \@@_exponent:w \s_@@ \@@_chk:w #1 { @@ -416,8 +365,8 @@ { \if_case:w \if_int_compare:w #2 > \c_@@_max_exponent_int 1 ~ \else: - \if_int_compare:w #2 < - \c_@@_max_exponent_int 2 ~ \else: - \if_meaning:w 1 #1 3 ~ \else: 0 ~ \fi: \fi: \fi: + \if_int_compare:w #2 < - \c_@@_minus_min_exponent_int 2 ~ \else: + \if_meaning:w 1 #1 3 ~ \fi: \fi: \fi: 0 ~ \or: \exp_after:wN \@@_overflow:w \or: \exp_after:wN \@@_underflow:w \or: \exp_after:wN \@@_sanitize_zero:w @@ -433,11 +382,11 @@ % % \subsection{Expanding after a floating point number} % -% ^^A todo: maybe delete \cs{@@_exp_after_o:nw}? % \begin{macro}[int, EXP]{\@@_exp_after_o:w} -% \begin{macro}[int, EXP]{\@@_exp_after_o:nw, \@@_exp_after_f:nw} +% \begin{macro}[int, EXP]{\@@_exp_after_f:nw} % \begin{syntax} -% \cs{@@_exp_after_o:nw} \Arg{tokens} \meta{floating point} \meta{more tokens} +% \cs{@@_exp_after_o:w} \meta{floating point} +% \cs{@@_exp_after_f:nw} \Arg{tokens} \meta{floating point} % \end{syntax} % Places \meta{tokens} (empty in the case of \cs{@@_exp_after_o:w}) % between the \meta{floating point} and the \meta{more tokens}, then @@ -458,16 +407,6 @@ { } #1 } -\cs_new:Npn \@@_exp_after_o:nw #1 \s_@@ \@@_chk:w #2 - { - \if_meaning:w 1 #2 - \exp_after:wN \@@_exp_after_normal:nNNw - \else: - \exp_after:wN \@@_exp_after_special:nNNw - \fi: - { #1 } - #2 - } \cs_new:Npn \@@_exp_after_f:nw #1 \s_@@ \@@_chk:w #2 { \if_meaning:w 1 #2 @@ -697,6 +636,58 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}[aux, EXP] +% { +% \@@_basics_pack_low:NNNNNw, +% \@@_basics_pack_high:NNNNNw, +% \@@_basics_pack_high_carry:w +% } +% Addition and multiplication of significands are done in two steps: +% first compute a (more or less) exact result, then round and pack +% digits in the final (braced) form. These functions take care of the +% packing, with special attention given to the case where rounding has +% caused a carry. Since rounding can only shift the final digit by +% $1$, a carry always produces an exact power of $10$. Thus, +% \cs{@@_basics_pack_high_carry:w} is always followed by four times +% |{0000}|. +% +% This is used in \pkg{l3fp-basics} and \pkg{l3fp-extended}. +% \begin{macrocode} +\cs_new:Npn \@@_basics_pack_low:NNNNNw #1 #2#3#4#5 #6; + { + #1 - 1 ; {#2#3#4#5} {#6} ; } +\cs_new:Npn \@@_basics_pack_high:NNNNNw #1 #2#3#4#5 #6; + { + \if_meaning:w 2 #1 + \@@_basics_pack_high_carry:w + \fi: + ; {#2#3#4#5} {#6} + } +\cs_new:Npn \@@_basics_pack_high_carry:w \fi: ; #1 + { \fi: + 1 ; {1000} } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[aux, EXP] +% { +% \@@_basics_pack_weird_low:NNNNw, +% \@@_basics_pack_weird_high:NNNNNNNNw +% } +% This is used in \pkg{l3fp-basics} for additions and +% divisions. Their syntax is confusing, hence the name. +% \begin{macrocode} +\cs_new:Npn \@@_basics_pack_weird_low:NNNNw #1 #2#3#4 #5; + { + \if_meaning:w 2 #1 + + 1 + \fi: + \__int_eval_end: + #2#3#4; {#5} ; + } +\cs_new:Npn \@@_basics_pack_weird_high:NNNNNNNNw + 1 #1#2#3#4 #5#6#7#8 #9; { ; {#1#2#3#4} {#5#6#7#8} {#9} } +% \end{macrocode} +% \end{macro} +% % \subsection{Decimate (dividing by a power of 10)} % % ^^A begin[todo] @@ -711,7 +702,7 @@ % \begin{syntax} % \meta{f_1} \meta{rounding} \Arg{X'_1} \Arg{X'_2} \meta{extra-digits} |;| % \end{syntax} -% where $0\leq\meta{X'_i}<10^{8}-1$ are $8$ digit numbers, +% where $0\leq\meta{X'_i}<10^{8}-1$ are $8$ digit integers, % forming the truncation of our number. In other words, % \[ % \left( @@ -727,15 +718,15 @@ % is the (non-$0$, non-$5$) digit closest to $10^{17}$ times the % difference. In particular, if the shift is $17$ or more, all % the digits are dropped, \meta{rounding} is $1$ (not $0$), and -% \meta{X'_1} \meta{X'_2} are both zero. +% \meta{X'_1} and \meta{X'_2} are both zero. % % If the shift is $1$, the \meta{rounding} digit is simply the % only digit that was pushed out of the brace groups (this is % important for subtraction). It would be more natural for the -% \meta{rounding} digit to be placed after the \meta{X_i}, +% \meta{rounding} digit to be placed after the \meta{X'_i}, % but the choice we make involves less reshuffling. % -% Note that this function fails for negative \meta{shift}. +% Note that this function treats negative \meta{shift} as $0$. % \begin{macrocode} \cs_new:Npn \@@_decimate:nNnnnn #1 { @@ -939,39 +930,28 @@ % \subsection{Integer floating points} % % \begin{macro}[int, EXP, pTF]{\@@_int:w} -% \begin{macro}[aux, EXP]{\@@_int_normal:nnnnn, \@@_int_test:Nw} -% Tests if the floating point argument is an integer. This holds if -% the rounding digit resulting from \cs{@@_decimate:nNnnnn} is~$0$. +% Tests if the floating point argument is an integer. For normal +% floating point numbers, this holds if the rounding digit resulting +% from \cs{@@_decimate:nNnnnn} is~$0$. % \begin{macrocode} -\prg_new_conditional:Npnn \@@_int:w \s_@@ \@@_chk:w #1 #2 #3; { TF , T , F , p } +\prg_new_conditional:Npnn \@@_int:w \s_@@ \@@_chk:w #1 #2 #3 #4; + { TF , T , F , p } { \if_case:w #1 \exp_stop_f: \prg_return_true: - \or: \@@_int_normal:nnnnn #3 + \or: + \if_charcode:w 0 + \@@_decimate:nNnnnn { \c_@@_prec_int - #3 } + \@@_use_i_until_s:nw #4 + \prg_return_true: + \else: + \prg_return_false: + \fi: \else: \prg_return_false: \fi: } -\cs_new:Npn \@@_int_normal:nnnnn #1 #2#3#4#5 - { - \if_int_compare:w #1 > 0 \exp_stop_f: - \@@_decimate:nNnnnn { \c_@@_prec_int - #1 } - \@@_int_test:Nw - {#2} {#3} {#4} {#5} - \else: - \prg_return_false: - \fi: - } -\cs_new:Npn \@@_int_test:Nw #1#2; - { - \if_meaning:w 0 #1 - \prg_return_true: - \else: - \prg_return_false: - \fi: - } % \end{macrocode} % \end{macro} -% \end{macro} % % \subsection{Small integer floating points} % @@ -985,20 +965,13 @@ % Tests if the floating point argument is an integer or $\pm\infty$. % If so, it is converted to an integer in the range $[-10^{8},10^{8}]$ % and fed as a braced argument to the \meta{true code}. -% Otherwise, the \meta{false code} is performed. First filter special -% cases: neither \texttt{nan} nor infinities are integers. Normal -% numbers with a non-positive exponent are never integers. When the -% exponent is greater than $8$, the number is too large for the range. -% Otherwise, decimate, and test the digits after the decimal -% separator. The \cs{use_iii:nnn} remove a trailing |;| and the true -% branch, leaving only the false branch. The \cs{__int_value:w} -% appearing in the case where the normal floating point is an integer -% takes care of expanding all the conditionals until the trailing |;|. -% That integer is fed to \cs{@@_small_int_true:wTF} which places it as -% a braced argument of the true branch. The \cs{use_i:nn} in -% \cs{@@_small_int_test:NnnwNTF} removes the top-level \cs{else:} -% coming from \cs{@@_small_int_normal:NnwTF}, hence will call the -% \cs{use_iii:nnn} which follows, taking the false branch. +% Otherwise, the \meta{false code} is performed. +% +% First filter special cases: zeros and infinities are integers, +% \texttt{nan} is not. For normal numbers, decimate. If the rounding +% digit is not $0$ run the \meta{false code}. If it is, then the +% integer is |#2| |#3|; use |#3| if |#2| vanishes and otherwise +% $10^{8}$. % \begin{macrocode} \cs_new:Npn \@@_small_int:wTF \s_@@ \@@_chk:w #1#2 { @@ -1018,27 +991,23 @@ \cs_new:Npn \@@_small_int_true:wTF #1; #2#3 { #2 {#1} } \cs_new:Npn \@@_small_int_normal:NnwTF #1#2#3; { - \if_int_compare:w #2 > 0 \exp_stop_f: - \@@_decimate:nNnnnn { \c_@@_prec_int - #2 } - \@@_small_int_test:NnnwNnw - #3 #1 {#2} - \else: - \exp_after:wN \use_iii:nnn - \fi: - ; + \@@_decimate:nNnnnn { \c_@@_prec_int - #2 } + \@@_small_int_test:NnnwNw + #3 #1 } -\cs_new:Npn \@@_small_int_test:NnnwNnw #1#2#3#4; #5#6 +\cs_new:Npn \@@_small_int_test:NnnwNw #1#2#3#4; #5 { \if_meaning:w 0 #1 \exp_after:wN \@@_small_int_true:wTF \__int_value:w \if_meaning:w 2 #5 - \fi: - \if_int_compare:w #6 > \c_@@_half_prec_int + \if_int_compare:w #2 > 0 \exp_stop_f: 1 0000 0000 \else: #3 \fi: + \exp_after:wN ; \else: - \use_i:nn + \exp_after:wN \use_ii:nn \fi: } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx index 6b4ed3846d3..34e2124eb4a 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,2016 The LaTeX3 Project +%% File: l3fp-basics.dtx Copyright (C) 2011-2014,2016,2017 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 @@ -22,8 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-basics.dtx 6943 2017-02-17 16:47:59Z bruno $ - {L3 Floating-point arithmetic} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -74,55 +74,20 @@ % Floating Point Arithmetic}, by David Goldberg, which can be found at % \texttt{http://cr.yp.to/2005-590/goldberg.pdf}. % -% \subsection{Common to several operations} -% % \begin{macro}[aux, EXP] % { -% \@@_basics_pack_low:NNNNNw, -% \@@_basics_pack_high:NNNNNw, -% \@@_basics_pack_high_carry:w +% \@@_parse_word_abs:N , +% \@@_parse_word_sign:N , +% \@@_parse_word_sqrt:N , % } -% Addition and multiplication of significands are done in two steps: -% first compute a (more or less) exact result, then round and pack -% digits in the final (braced) form. These functions take care of the -% packing, with special attention given to the case where rounding has -% caused a carry. Since rounding can only shift the final digit by -% $1$, a carry always produces an exact power of $10$. Thus, -% \cs{@@_basics_pack_high_carry:w} is always followed by four times -% |{0000}|. +% Unary functions. % \begin{macrocode} -\cs_new:Npn \@@_basics_pack_low:NNNNNw #1 #2#3#4#5 #6; - { + #1 - 1 ; {#2#3#4#5} {#6} ; } -\cs_new:Npn \@@_basics_pack_high:NNNNNw #1 #2#3#4#5 #6; - { - \if_meaning:w 2 #1 - \@@_basics_pack_high_carry:w - \fi: - ; {#2#3#4#5} {#6} - } -\cs_new:Npn \@@_basics_pack_high_carry:w \fi: ; #1 - { \fi: + 1 ; {1000} } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[aux, EXP] -% { -% \@@_basics_pack_weird_low:NNNNw, -% \@@_basics_pack_weird_high:NNNNNNNNw -% } -% I don't fully understand those functions, used for additions and -% divisions. Hence the name. -% \begin{macrocode} -\cs_new:Npn \@@_basics_pack_weird_low:NNNNw #1 #2#3#4 #5; - { - \if_meaning:w 2 #1 - + 1 - \fi: - \__int_eval_end: - #2#3#4; {#5} ; - } -\cs_new:Npn \@@_basics_pack_weird_high:NNNNNNNNw - 1 #1#2#3#4 #5#6#7#8 #9; { ; {#1#2#3#4} {#5#6#7#8} {#9} } +\cs_new:Npn \@@_parse_word_abs:N + { \@@_parse_unary_function:NNN \@@_set_sign_o:w 0 } +\cs_new:Npn \@@_parse_word_sign:N + { \@@_parse_unary_function:NNN \@@_sign_o:w ? } +\cs_new:Npn \@@_parse_word_sqrt:N + { \@@_parse_unary_function:NNN \@@_sqrt_o:w ? } % \end{macrocode} % \end{macro} % @@ -149,7 +114,7 @@ % opposite signs, shift the significand of the smaller one to match the % bigger one, perform the addition or subtraction of significands, % check for a carry, round, and pack using the -% |\__fp_basics_pack_...| functions. +% \cs[no-index]{__fp_basics_pack_\ldots{}} functions. % \end{itemize} % The trickiest part is to round correctly when adding or subtracting % normal floating point numbers. @@ -157,15 +122,11 @@ % \subsubsection{Sign, exponent, and special numbers} % % \begin{macro}[int, EXP]{\@@_-_o:ww} -% A previous version of this function grabbed its two operands, -% changed the sign of the second, and called \cs{@@_+_o:ww}. However, -% for efficiency reasons, the operands were swapped in the process, -% which means that error messages ended up wrong. Now, the -% \cs{@@_+_o:ww} auxiliary has a hook: it takes one argument between -% the first \cs{s_@@} and \cs{@@_chk:w}, which is applied to the sign -% of the second operand. Positioning the hook there means that -% \cs{@@_+_o:ww} can still check that it was followed by \cs{s_@@} and -% not arbitrary junk. +% The \cs{@@_+_o:ww} auxiliary has a hook: it takes one argument +% between the first \cs{s_@@} and \cs{@@_chk:w}, which is applied to +% the sign of the second operand. Positioning the hook there means +% that \cs{@@_+_o:ww} can still perform the sanity check that it was +% followed by \cs{s_@@}. % \begin{macrocode} \cs_new:cpx { @@_-_o:ww } \s_@@ { @@ -178,8 +139,8 @@ % \begin{macro}[int, EXP]{\@@_+_o:ww} % This function is either called directly with an empty |#1| to % compute an addition, or it is called by \cs{@@_-_o:ww} with -% \cs{@@_neg_sign:N} as |#1| to compute a subtraction (equivalent to -% changing the \meta{sign_2} of the second operand). If the +% \cs{@@_neg_sign:N} as |#1| to compute a subtraction, in which case +% the second operand's sign should be changed. If the % \meta{types} |#2| and |#4| are the same, dispatch to case |#2| ($0$, % $1$, $2$, or $3$), where we call specialized functions: thanks to % \cs{__int_value:w}, those receive the tweaked \meta{sign_2} @@ -259,13 +220,8 @@ \else: \@@_case_use:nw { - \if_meaning:w #1 #4 - \exp_after:wN \@@_invalid_operation_o:Nww - \exp_after:wN + - \else: - \exp_after:wN \@@_invalid_operation_o:Nww - \exp_after:wN - - \fi: + \exp_last_unbraced:Nf \@@_invalid_operation_o:Nww + { \token_if_eq_meaning:NNTF #1 #4 + - } } \fi: \s_@@ \@@_chk:w 2 #2 #3; @@ -342,6 +298,7 @@ % \cs{@@_add_big_i_o:wNww} \meta{shift} |;| \meta{final sign} % \meta{body_1} |;| \meta{body_2} |;| % \end{quote} +% Used in \pkg{l3fp-expo}. % Shift the significand of the small number, then add with % \cs{@@_add_significand_o:NnnwnnnnN}. % \begin{macrocode} @@ -854,6 +811,8 @@ % significand. The \meta{final sign} is needed to do the rounding % properly in the significand computation. We setup the post-expansion % here, triggered by \cs{@@_mul_significand_o:nnnnNnnnn}. +% +% This is also used in \pkg{l3fp-convert}. % \begin{macrocode} \cs_new:Npn \@@_mul_npos_o:Nww #1 \s_@@ \@@_chk:w #2 #3 #4 #5 ; \s_@@ \@@_chk:w #6 #7 #8 #9 ; @@ -2070,7 +2029,27 @@ % \end{macrocode} % \end{macro} % -% \subsection{Setting the sign} +% \subsection{About the sign} +% +% \begin{macro}[int, EXP]{\@@_sign_o:w} +% \begin{macro}[aux, EXP]{\@@_sign_aux_o:w} +% Find the sign of the floating point: \texttt{nan}, |+0|, |-0|, |+1| or |-1|. +% \begin{macrocode} +\cs_new:Npn \@@_sign_o:w ? \s_@@ \@@_chk:w #1#2; @ + { + \if_case:w #1 \exp_stop_f: + \@@_case_return_same_o:w + \or: \exp_after:wN \@@_sign_aux_o:w + \or: \exp_after:wN \@@_sign_aux_o:w + \else: \@@_case_return_same_o:w + \fi: + \s_@@ \@@_chk:w #1 #2; + } +\cs_new:Npn \@@_sign_aux_o:w \s_@@ \@@_chk:w #1 #2 #3 ; + { \exp_after:wN \@@_set_sign_o:w \exp_after:wN #2 \c_one_fp @ } +% \end{macrocode} +% \end{macro} +% \end{macro} % % \begin{macro}[int, EXP]{\@@_set_sign_o:w} % This function is used for the unary minus and for \texttt{abs}. It diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx index fa3fe89a2ac..48cca2876a0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-convert.dtx Copyright(C) 2011-2014,2016 The LaTeX3 Project +%% File: l3fp-convert.dtx Copyright(C) 2011-2014,2016,2017 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 @@ -22,8 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-convert.dtx 6943 2017-02-17 16:47:59Z bruno $ - {L3 Floating-point conversion} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -135,18 +135,15 @@ \or: \@@_case_use:nw { - \exp_args:Nf \@@_invalid_operation:nnw - { - \@@_expand:n - { { 1.000000000000000e } \int_use:N \c_@@_max_exponent_int } - } + \@@_invalid_operation:nnw + { \fp_to_scientific:N \c_@@_overflowing_fp } { fp_to_scientific } } \or: \@@_case_use:nw { \@@_invalid_operation:nnw - { 0.000000000000000e0 } + { \fp_to_scientific:N \c_zero_fp } { fp_to_scientific } } \fi: @@ -215,10 +212,7 @@ \@@_case_use:nw { \@@_invalid_operation:nnw - { - \exp_after:wN \exp_after:wN \exp_after:wN 1 - \prg_replicate:nn \c_@@_max_exponent_int 0 - } + { \fp_to_decimal:N \c_@@_overflowing_fp } { fp_to_decimal } } \or: @@ -338,7 +332,7 @@ % % \begin{macro}[EXP]{\fp_to_dim:N, \fp_to_dim:c, \fp_to_dim:n} % These three public functions rely on \cs{fp_to_decimal:n} -% internally. We make sure to produce |pt| with category other. +% internally. % \begin{macrocode} \cs_new:Npn \fp_to_dim:N #1 { \fp_to_decimal:N #1 pt } @@ -398,7 +392,7 @@ % \cs{@@_from_dim_test:ww}, and is combined with the exponent $-4$ % of $2^{-16}$. There is also a need to expand afterwards: this is % performed by \cs{@@_mul_npos_o:Nww}, and cancelled by -% \cs{prg_do_nothing:} in \cs{dim_to_fp:n}. +% \cs{prg_do_nothing:} here. % \begin{macrocode} \cs_new:Npn \dim_to_fp:n #1 { diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx index d085fd70484..8c60c2a3246 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx @@ -22,8 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-expo.dtx 6943 2017-02-17 16:47:59Z bruno $ - {L3 Floating-point exponential-related functions} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -62,6 +62,20 @@ %<@@=fp> % \end{macrocode} % +% \begin{macro}[aux, EXP] +% { +% \@@_parse_word_exp:N , +% \@@_parse_word_ln:N , +% } +% Unary functions. +% \begin{macrocode} +\cs_new:Npn \@@_parse_word_exp:N + { \@@_parse_unary_function:NNN \@@_exp_o:w ? } +\cs_new:Npn \@@_parse_word_ln:N + { \@@_parse_unary_function:NNN \@@_ln_o:w ? } +% \end{macrocode} +% \end{macro} +% % \subsection{Logarithm} % % \subsubsection{Work plan} @@ -118,15 +132,15 @@ % Those are needed in the implementation. It turns out that we don't % need the value of $\ln(5)$. % \begin{macrocode} -\tl_const:Nn \c_@@_ln_i_fixed_tl { {0000}{0000}{0000}{0000}{0000}{0000} } -\tl_const:Nn \c_@@_ln_ii_fixed_tl { {6931}{4718}{0559}{9453}{0941}{7232} } -\tl_const:Nn \c_@@_ln_iii_fixed_tl {{10986}{1228}{8668}{1096}{9139}{5245} } -\tl_const:Nn \c_@@_ln_iv_fixed_tl {{13862}{9436}{1119}{8906}{1883}{4464} } -\tl_const:Nn \c_@@_ln_vi_fixed_tl {{17917}{5946}{9228}{0550}{0081}{2477} } -\tl_const:Nn \c_@@_ln_vii_fixed_tl {{19459}{1014}{9055}{3133}{0510}{5353} } -\tl_const:Nn \c_@@_ln_viii_fixed_tl{{20794}{4154}{1679}{8359}{2825}{1696} } -\tl_const:Nn \c_@@_ln_ix_fixed_tl {{21972}{2457}{7336}{2193}{8279}{0490} } -\tl_const:Nn \c_@@_ln_x_fixed_tl {{23025}{8509}{2994}{0456}{8401}{7991} } +\tl_const:Nn \c_@@_ln_i_fixed_tl { {0000}{0000}{0000}{0000}{0000}{0000};} +\tl_const:Nn \c_@@_ln_ii_fixed_tl { {6931}{4718}{0559}{9453}{0941}{7232};} +\tl_const:Nn \c_@@_ln_iii_fixed_tl {{10986}{1228}{8668}{1096}{9139}{5245};} +\tl_const:Nn \c_@@_ln_iv_fixed_tl {{13862}{9436}{1119}{8906}{1883}{4464};} +\tl_const:Nn \c_@@_ln_vi_fixed_tl {{17917}{5946}{9228}{0550}{0081}{2477};} +\tl_const:Nn \c_@@_ln_vii_fixed_tl {{19459}{1014}{9055}{3133}{0510}{5353};} +\tl_const:Nn \c_@@_ln_viii_fixed_tl{{20794}{4154}{1679}{8359}{2825}{1696};} +\tl_const:Nn \c_@@_ln_ix_fixed_tl {{21972}{2457}{7336}{2193}{8279}{0490};} +\tl_const:Nn \c_@@_ln_x_fixed_tl {{23025}{8509}{2994}{0456}{8401}{7991};} % \end{macrocode} % \end{variable} % @@ -303,7 +317,8 @@ % not the end result, we need to know it with more accuracy % (on the other hand, the ending is much simpler, as we don't % need an exact rounding for transcendental functions, but just -% a faithful rounding).\footnote{Bruno: to be completed.} +% a faithful rounding). +% ^^A todo: doc % % \begin{quote} % \cs{@@_ln_x_iv:wnnnnnnnn} @@ -343,10 +358,9 @@ \__int_value:w \__int_eval:w 1000000 + #2 #3 / #1 ; % Q6 } % \end{macrocode} -% We now have essentially\footnote{Bruno: add a mention that -% the error on $Q_{6}$ is bounded by $10$ (probably $6.7$), -% and thus corresponds to an error of $10^{-23}$ on the final -% result, small enough in all cases.} +% We now have essentially +% ^^A todo: determine error on $Q_{6}$ (probably $6.7$), +% ^^A todo: conclude the final result is off by $<10^{-23}$ % \begin{quote} % \cs{@@_ln_div_after:Nw} \meta{fixed tl} % \cs{@@_div_significand_pack:NNN} $10^6 + Q_{1}$ @@ -449,7 +463,7 @@ % \cs{@@_ln_Taylor:wwNw} % \Arg{T_1} \Arg{T_2} \Arg{T_3} \Arg{T_4} \Arg{T_5} \Arg{T_6} |;| |;| % \Arg{(2t)_1} \Arg{(2t)_2} \Arg{(2t)_3} \Arg{(2t)_4} \Arg{(2t)_5} \Arg{(2t)_6} |;| -% |{| \cs{@@_ln_c:NwNn} \meta{sign} |}| +% |{| \cs{@@_ln_c:NwNw} \meta{sign} |}| % \meta{fixed tl} \meta{exponent} |;| \meta{continuation} % \end{quote} % And we want to compute @@ -467,7 +481,7 @@ % \mul B; T; {\loop 3;} % \loop 3; C; % \end{verbatim} -% \footnote{Bruno: add explanations.} +% ^^A todo: doc % % This uses the routine for dividing a number by a small integer % (${}<10^4$). @@ -479,7 +493,7 @@ \if_int_compare:w #1 = 1 \exp_stop_f: \@@_ln_Taylor_break:w \fi: - \exp_after:wN \@@_fixed_div_int:wwN \c_@@_one_fixed_tl ; #1; + \exp_after:wN \@@_fixed_div_int:wwN \c_@@_one_fixed_tl #1; \@@_fixed_add:wwn #2; \@@_fixed_mul:wwn #3; { @@ -511,7 +525,7 @@ % For now, $\ln(x)$ is given as $\cdot 10^0$. Unless both the exponent % is $1$ and $c=1$, we shift to working in units of $\cdot 10^4$, % since the final result will be at least $\ln(10/7) \simeq -% 0.35$.\footnote{Bruno: that was wrong at some point, I must check.} +% 0.35$. % \begin{macrocode} \cs_new:Npn \@@_ln_c:NwNw #1 #2; #3 { @@ -520,10 +534,9 @@ \else: \exp_after:wN \exp_after:wN \exp_after:wN \@@_fixed_add:wwn \fi: - #3 ; #2 ; + #3 #2 ; } % \end{macrocode} -% \footnote{Bruno: this \emph{\textbf{must}} be updated with correct values!} % \end{macro} % % \begin{macro}{\@@_ln_exponent:wn} @@ -546,7 +559,7 @@ \cs_new:Npn \@@_ln_exponent:wn #1; #2 { \if_case:w #2 \exp_stop_f: - 0 \@@_case_return:nw { \@@_fixed_to_float:Nw 2 } + 0 \@@_case_return:nw { \@@_fixed_to_float_o:Nw 2 } \or: \exp_after:wN \@@_ln_exponent_one:ww \__int_value:w \else: @@ -569,8 +582,8 @@ \cs_new:Npn \@@_ln_exponent_one:ww 1; #1; { 0 - \exp_after:wN \@@_fixed_sub:wwn \c_@@_ln_x_fixed_tl ; #1; - \@@_fixed_to_float:wN 0 + \exp_after:wN \@@_fixed_sub:wwn \c_@@_ln_x_fixed_tl #1; + \@@_fixed_to_float_o:wN 0 } % \end{macrocode} % For small exponents, we just drop one block of digits, and set the @@ -582,11 +595,11 @@ { 4 \exp_after:wN \@@_fixed_mul:wwn - \c_@@_ln_x_fixed_tl ; + \c_@@_ln_x_fixed_tl {#3}{0000}{0000}{0000}{0000}{0000} ; #2 {0000}{#4}{#5}{#6}{#7}{#8}; - \@@_fixed_to_float:wN #1 + \@@_fixed_to_float_o:wN #1 } % \end{macrocode} % \end{macro} @@ -602,7 +615,7 @@ \if_case:w #2 \exp_stop_f: \@@_case_return_o:Nw \c_one_fp \or: - \exp_after:wN \@@_exp_normal:w + \exp_after:wN \@@_exp_normal_o:w \or: \if_meaning:w 0 #3 \exp_after:wN \@@_case_return_o:Nw @@ -619,64 +632,62 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[aux, EXP]{\@@_exp_normal:w, \@@_exp_pos:Nnwnw} +% \begin{macro}[aux, EXP]{\@@_exp_normal_o:w, \@@_exp_pos_o:Nnwnw, \@@_exp_overflow:NN} % \begin{macrocode} -\cs_new:Npn \@@_exp_normal:w \s_@@ \@@_chk:w 1#1 +\cs_new:Npn \@@_exp_normal_o:w \s_@@ \@@_chk:w 1#1 { \if_meaning:w 0 #1 - \@@_exp_pos:NNwnw + \@@_fixed_to_float:wN + \@@_exp_pos_o:NNwnw + \@@_fixed_to_float_o:wN \else: - \@@_exp_pos:NNwnw - \@@_fixed_inv_to_float:wN + \@@_exp_pos_o:NNwnw - \@@_fixed_inv_to_float_o:wN \fi: } -\cs_new:Npn \@@_exp_pos:NNwnw #1#2#3 \fi: #4#5; +\cs_new:Npn \@@_exp_pos_o:NNwnw #1#2#3 \fi: #4#5; { \fi: - \exp_after:wN \@@_sanitize:Nw - \exp_after:wN 0 - \__int_value:w #1 \__int_eval:w - \if_int_compare:w #4 < - \c_@@_half_prec_int - 1 - \exp_after:wN \@@_add_big_i_o:wNww - \__int_value:w \__int_eval:w 1 - #4 ; - 0 {1000}{0000}{0000}{0000} ; #5; - \exp:w - \else: - \if_int_compare:w #4 > \c_@@_max_exp_exponent_int - \exp_after:wN \@@_exp_overflow: - \exp:w + \if_int_compare:w #4 > \c_@@_max_exp_exponent_int + \token_if_eq_charcode:NNTF + #1 + { \@@_exp_overflow:NN \@@_overflow:w \c_inf_fp } + { \@@_exp_overflow:NN \@@_underflow:w \c_zero_fp } + \exp:w + \else: + \exp_after:wN \@@_sanitize:Nw + \exp_after:wN 0 + \__int_value:w #1 \__int_eval:w + \if_int_compare:w #4 < 0 \exp_stop_f: + \exp_after:wN \use_i:nn \else: - \if_int_compare:w #4 < 0 \exp_stop_f: - \exp_after:wN \use_i:nn - \else: - \exp_after:wN \use_ii:nn - \fi: - { - 0 - \@@_decimate:nNnnnn { - #4 } - \@@_exp_Taylor:Nnnwn - } - { - \@@_decimate:nNnnnn { \c_@@_prec_int - #4 } - \@@_exp_pos_large:NnnNwn - } - #5 - {#4} - #1 #2 0 - \exp:w + \exp_after:wN \use_ii:nn \fi: - \fi: + { + 0 + \@@_decimate:nNnnnn { - #4 } + \@@_exp_Taylor:Nnnwn + } + { + \@@_decimate:nNnnnn { \c_@@_prec_int - #4 } + \@@_exp_pos_large:NnnNwn + } + #5 + {#4} + #1 #2 0 + \exp:w + \fi: \exp_after:wN \exp_end: } -\cs_new:Npn \@@_exp_overflow: - { + 2 * \c_@@_max_exponent_int ; {1000} {0000} {0000} {0000} ; } +\cs_new:Npn \@@_exp_overflow:NN #1#2 + { + \exp_after:wN \exp_after:wN + \exp_after:wN #1 + \exp_after:wN #2 + } % \end{macrocode} % \end{macro} % % \begin{macro}[int, EXP]{\@@_exp_Taylor:Nnnwn} % \begin{macro}[aux, EXP]{\@@_exp_Taylor_loop:www, \@@_exp_Taylor_break:Nww} % This function is called for numbers in the range $[10^{-9}, -% 10^{-1})$. Our only task is to compute the Taylor series. The +% 10^{-1})$. We compute $10$ terms of the Taylor series. The % first argument is irrelevant (rounding digit used by some other % functions). The next three arguments, at least $16$ digits, % delimited by a semicolon, form a fixed point number, so we pack it @@ -748,7 +759,6 @@ \exp_after:wN \exp_after:wN \cs:w @@_exp_large_ \__int_to_roman:w #6 :wN \exp_after:wN \cs_end: \exp_after:wN \c_@@_one_fixed_tl - \exp_after:wN ; \__int_value:w #3 #4 \exp_stop_f: #5 00000 ; } @@ -890,14 +900,14 @@ % Then test the sign of $a$. % \begin{itemize} % \item If it is positive, and $a$ is a normal number, call -% \cs{@@_pow_normal:ww} followed by the two \texttt{fp} $a$ and $b$. +% \cs{@@_pow_normal_o:ww} followed by the two \texttt{fp} $a$ and $b$. % For $a=+0$ or $+\inf$, call \cs{@@_pow_zero_or_inf:ww} instead, to % return either $+0$ or $+\infty$ as appropriate. % \item If $a$ is a \texttt{nan}, then skip to the next semicolon % (which happens to be conveniently the end of $b$) and return % \texttt{nan}. % \item Finally, if $a$ is negative, compute $|a|^b$ -% (\cs{@@_pow_normal:ww} which ignores the sign of its first +% (\cs{@@_pow_normal_o:ww} which ignores the sign of its first % operand), and keep an extra copy of $a$ and $b$ (the second brace % group, containing \{~$b$~$a$~\}, is inserted between $a$ and $b$). % Then do some tests to find the final sign of the result if it @@ -920,7 +930,7 @@ \fi: { \if_meaning:w 1 #1 - \exp_after:wN \@@_pow_normal:ww + \exp_after:wN \@@_pow_normal_o:ww \else: \exp_after:wN \@@_pow_zero_or_inf:ww \fi: @@ -968,7 +978,7 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[aux, EXP]{\@@_pow_normal:ww} +% \begin{macro}[aux, EXP]{\@@_pow_normal_o:ww} % We have in front of us $a$, and $b\neq 0$, we know that $a$ is a % normal number, and we wish to compute $\lvert a\rvert^{b}$. If % $\lvert a\rvert=1$, we return $1$, unless $a=-1$ and $b$ is @@ -977,13 +987,13 @@ % a\rvert\neq 1$, test the type of $b$: % \begin{itemize} % \item[0] Impossible, we already filtered $b=\pm 0$. -% \item[1] Call \cs{@@_pow_npos:ww}. +% \item[1] Call \cs{@@_pow_npos_o:Nww}. % \item[2] Return $+\infty$ or $+0$ depending on the sign of $b$ and % whether the exponent of $a$ is positive or not. % \item[3] Return $b$. % \end{itemize} % \begin{macrocode} -\cs_new:Npn \@@_pow_normal:ww +\cs_new:Npn \@@_pow_normal_o:ww \s_@@ \@@_chk:w 1 #1#2#3; \s_@@ \@@_chk:w #4#5 { \if_int_compare:w \__str_if_eq_x:nn { #2 #3 } @@ -995,7 +1005,7 @@ \fi: \if_case:w #4 \exp_stop_f: \or: - \exp_after:wN \@@_pow_npos:Nww + \exp_after:wN \@@_pow_npos_o:Nww \exp_after:wN #5 \or: \if_meaning:w 2 #5 \exp_after:wN \reverse_if:N \fi: @@ -1016,7 +1026,7 @@ % \end{macro} % % ^^A todo: check that we compute ln to 21 digits! -% \begin{macro}[aux, EXP]{\@@_pow_npos:Nww} +% \begin{macro}[aux, EXP]{\@@_pow_npos_o:Nww} % We now know that $a\neq\pm 1$ is a normal number, and $b$ is a % normal number too. We want to compute $\lvert a\rvert^{b} = (\lvert % x\rvert\cdot 10^{n})^{y\cdot 10^{p}} = \exp((\ln\lvert x\rvert + n @@ -1029,7 +1039,7 @@ % is negative, negate that decimal exponent, and prepare to take the % inverse when converting from the fixed point to the floating point result. % \begin{macrocode} -\cs_new:Npn \@@_pow_npos:Nww #1 \s_@@ \@@_chk:w 1#2#3 +\cs_new:Npn \@@_pow_npos_o:Nww #1 \s_@@ \@@_chk:w 1#2#3 { \exp_after:wN \@@_sanitize:Nw \exp_after:wN 0 @@ -1037,11 +1047,11 @@ \if:w #1 \if_int_compare:w #3 > 0 \exp_stop_f: 0 \else: 2 \fi: \exp_after:wN \@@_pow_npos_aux:NNnww \exp_after:wN + - \exp_after:wN \@@_fixed_to_float:wN + \exp_after:wN \@@_fixed_to_float_o:wN \else: \exp_after:wN \@@_pow_npos_aux:NNnww \exp_after:wN - - \exp_after:wN \@@_fixed_inv_to_float:wN + \exp_after:wN \@@_fixed_inv_to_float_o:wN \fi: {#3} } @@ -1062,7 +1072,7 @@ \@@_pow_exponent:wnN {#3} \@@_fixed_mul:wwn #8 {0000}{0000} ; \@@_pow_B:wwN #7; - #1 #2 0 % fixed_to_float:wN + #1 #2 0 % fixed_to_float_o:wN } \cs_new:Npn \@@_pow_exponent:wnN #1; #2 { @@ -1114,7 +1124,7 @@ \cs_new:Npn \@@_pow_C_overflow:w #1; #2; #3 { + 2 * \c_@@_max_exponent_int - \exp_after:wN \@@_fixed_continue:wn \c_@@_one_fixed_tl ; + \exp_after:wN \@@_fixed_continue:wn \c_@@_one_fixed_tl } \cs_new:Npn \@@_pow_C_neg:w #1 ; 1 { @@ -1138,7 +1148,7 @@ \fi: } \cs_new:Npn \@@_pow_C_pack:w - { \exp_after:wN \@@_exp_large_v:wN \c_@@_one_fixed_tl ; } + { \exp_after:wN \@@_exp_large_v:wN \c_@@_one_fixed_tl } % \end{macrocode} % \end{macro} %^^A end[todo] diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx index 59f734632b4..a6e66dd36bf 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-extended.dtx Copyright (C) 2011-2014,2016 The LaTeX3 Project +%% File: l3fp-extended.dtx Copyright (C) 2011-2014,2016,2017 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 @@ -22,8 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-extended.dtx 6943 2017-02-17 16:47:59Z bruno $ - {L3 Floating-points with extended precision} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -105,25 +105,23 @@ % appropriate for computing continued fractions and Taylor series. % % At the end of the calculation, the result is turned back to a floating -% point number using \cs{@@_fixed_to_float:wN}. This function has to +% point number using \cs{@@_fixed_to_float_o:wN}. This function has to % change the exponent of the floating point number: it must be used % after starting an integer expression for the overall exponent of the % result. % % \subsection{Helpers for numbers with extended precision} % -% ^^A todo: put trailing semicolon here? % \begin{variable}[int]{\c_@@_one_fixed_tl} % The fixed-point number~$1$, used in \pkg{l3fp-expo}. % \begin{macrocode} \tl_const:Nn \c_@@_one_fixed_tl - { {10000} {0000} {0000} {0000} {0000} {0000} } + { {10000} {0000} {0000} {0000} {0000} {0000} ; } % \end{macrocode} % \end{variable} % % \begin{macro}[int, EXP]{\@@_fixed_continue:wn} -% This function does nothing. Of course, there is no bound on -% $a_1$ (except \TeX{}'s own $2^{31}-1$). +% This function simply calls the next function. % \begin{macrocode} \cs_new:Npn \@@_fixed_continue:wn #1; #2 { #2 #1; } % \end{macrocode} @@ -135,7 +133,7 @@ % \end{syntax} % This function adds $1$ to the fixed point \meta{a}, by changing % $a_1$ to $10000+a_1$, then calls the \meta{continuation}. This -% requires $a_1 \leq 2^{31} - 10001$. +% requires $a_1 + 10000 < 2^{31}$. % \begin{macrocode} \cs_new:Npn \@@_fixed_add_one:wN #1#2; #3 { @@ -167,9 +165,7 @@ % \begin{macro}[aux, EXP]{\@@_fixed_mul_after:wwn} % The fixed point operations which involve multiplication end by % calling this auxiliary. It braces the last block of digits, and -% places the \meta{continuation} |#2| in front. The -% \meta{continuation} was brought up through the expansions by -% the packing functions. +% places the \meta{continuation} |#3| in front. % \begin{macrocode} \cs_new:Npn \@@_fixed_mul_after:wwn #1; #2; #3 { #3 {#1} #2; } % \end{macrocode} @@ -625,14 +621,17 @@ % comma, then six groups of digits, ending with a semicolon. The first % group of digit may be any non-negative integer, while other groups of % digits have $4$~digits. In other words, an extended-precision number -% is an exponent ending in a comma, then a fixed point number. +% is an exponent ending in a comma, then a fixed point number. The +% corresponding value is $0.\meta{digits}\cdot 10^{\meta{exponent}}$. +% This convention differs from floating points. % % \begin{macro}[int, EXP]{\@@_ep_to_fixed:wwn} % \begin{macro}[aux, EXP] % {\@@_ep_to_fixed_auxi:www, \@@_ep_to_fixed_auxii:nnnnnnnwn} % Converts an extended-precision number with an exponent at most~$4$ -% to a fixed point number whose first block will have $12$~digits, -% most often starting with many zeros. +% and a first block less than $10^{8}$ to a fixed point number whose +% first block will have $12$~digits, hopefully starting with many +% zeros. % \begin{macrocode} \cs_new:Npn \@@_ep_to_fixed:wwn #1,#2 { @@ -1142,55 +1141,55 @@ % \end{macro} % % \subsection{Converting from fixed point to floating point} -% ^^A todo: doc and turn ..._to_float:... -> ..._to_float_o:... +% ^^A todo: doc % % After computing Taylor series, we wish to convert the result from % extended precision (with or without an exponent) to the public % floating point format. The functions here should be called within an % integer expression for the overall exponent of the floating point. % -% \begin{macro}[int, rEXP]{\@@_ep_to_float:wwN, \@@_ep_inv_to_float:wwN} +% \begin{macro}[int, rEXP]{\@@_ep_to_float_o:wwN, \@@_ep_inv_to_float_o:wwN} % An extended-precision number is simply a comma-delimited exponent % followed by a fixed point number. Leave the exponent in the current % integer expression then convert the fixed point number. % \begin{macrocode} -\cs_new:Npn \@@_ep_to_float:wwN #1, - { + \__int_eval:w #1 \@@_fixed_to_float:wN } -\cs_new:Npn \@@_ep_inv_to_float:wwN #1,#2; +\cs_new:Npn \@@_ep_to_float_o:wwN #1, + { + \__int_eval:w #1 \@@_fixed_to_float_o:wN } +\cs_new:Npn \@@_ep_inv_to_float_o:wwN #1,#2; { \@@_ep_div:wwwwn 1,{1000}{0000}{0000}{0000}{0000}{0000}; #1,#2; - \@@_ep_to_float:wwN + \@@_ep_to_float_o:wwN } % \end{macrocode} % \end{macro} % -% \begin{macro}[rEXP, int]{\@@_fixed_inv_to_float:wN} +% \begin{macro}[rEXP, int]{\@@_fixed_inv_to_float_o:wN} % Another function which reduces to converting an extended precision % number to a float. % \begin{macrocode} -\cs_new:Npn \@@_fixed_inv_to_float:wN - { \@@_ep_inv_to_float:wwN 0, } +\cs_new:Npn \@@_fixed_inv_to_float_o:wN + { \@@_ep_inv_to_float_o:wwN 0, } % \end{macrocode} % \end{macro} % -% \begin{macro}[rEXP, int]{\@@_fixed_to_float_rad:wN} +% \begin{macro}[rEXP, int]{\@@_fixed_to_float_rad_o:wN} % Converts the fixed point number~|#1| from degrees to radians then to % a floating point number. This could perhaps remain in % \pkg{l3fp-trig}. % \begin{macrocode} -\cs_new:Npn \@@_fixed_to_float_rad:wN #1; +\cs_new:Npn \@@_fixed_to_float_rad_o:wN #1; { \@@_fixed_mul:wwn #1; {5729}{5779}{5130}{8232}{0876}{7981}; - { \@@_ep_to_float:wwN 2, } + { \@@_ep_to_float_o:wwN 2, } } % \end{macrocode} % \end{macro} % % ^^A todo: make exponents end in ',' consistently throughout l3fp % \begin{macro}[int, rEXP] -% {\@@_fixed_to_float:wN, \@@_fixed_to_float:Nw} +% {\@@_fixed_to_float_o:wN, \@@_fixed_to_float_o:Nw} % \begin{syntax} -% \ldots{} \cs{__int_eval:w} \meta{exponent} \cs{@@_fixed_to_float:wN} \Arg{a_1} \Arg{a_2} \Arg{a_3} \Arg{a_4} \Arg{a_5} \Arg{a_6} |;| \meta{sign} +% \ldots{} \cs{__int_eval:w} \meta{exponent} \cs{@@_fixed_to_float_o:wN} \Arg{a_1} \Arg{a_2} \Arg{a_3} \Arg{a_4} \Arg{a_5} \Arg{a_6} |;| \meta{sign} % \end{syntax} % yields % \begin{quote} @@ -1204,8 +1203,8 @@ % %^^A todo: round properly when rounding to infinity: I need the sign. % \begin{macrocode} -\cs_new:Npn \@@_fixed_to_float:Nw #1#2; { \@@_fixed_to_float:wN #2; #1 } -\cs_new:Npn \@@_fixed_to_float:wN #1#2#3#4#5#6; #7 +\cs_new:Npn \@@_fixed_to_float_o:Nw #1#2; { \@@_fixed_to_float_o:wN #2; #1 } +\cs_new:Npn \@@_fixed_to_float_o:wN #1#2#3#4#5#6; #7 { + \__int_eval:w \c_@@_block_int % for the 8-digit-at-the-start thing. \exp_after:wN \exp_after:wN diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx index 1c723576874..c6c59b1ad55 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-logic.dtx Copyright (C) 2011-2014,2016 The LaTeX3 Project +%% File: l3fp-logic.dtx Copyright (C) 2011-2014,2016,2017 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 @@ -22,8 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-logic.dtx 6987 2017-03-11 01:06:52Z bruno $ - {L3 Floating-point conditionals} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -62,6 +62,16 @@ %<@@=fp> % \end{macrocode} % +% \begin{macro}[aux, EXP]{\@@_parse_word_max:N , \@@_parse_word_min:N} +% Those functions may receive a variable number of arguments. +% \begin{macrocode} +\cs_new:Npn \@@_parse_word_max:N + { \@@_parse_function:NNN \@@_minmax_o:Nw 2 } +\cs_new:Npn \@@_parse_word_min:N + { \@@_parse_function:NNN \@@_minmax_o:Nw 0 } +% \end{macrocode} +% \end{macro} +% % \subsection{Syntax of internal functions} % % \begin{itemize} @@ -341,7 +351,7 @@ \token_if_eq_meaning:NNTF #2 0 { \__msg_kernel_expandable_error:nnn { kernel } { zero-step } {#6} } { - \@@_error:nnfn { bad-step } { } + \@@_error:nnfn { fp-bad-step } { } { \fp_to_tl:n { \s_@@ \@@_chk:w #2#3#4 ; } } {#6} } \use_none:nnnnn @@ -352,7 +362,7 @@ { \fp_compare:nNnTF {#2} = {#3} { - \@@_error:nffn { tiny-step } + \@@_error:nffn { fp-tiny-step } { \fp_to_tl:n {#3} } { \fp_to_tl:n {#4} } {#6} } { @@ -480,26 +490,6 @@ % % \subsection{Boolean operations} % -% \begin{macro}[int, EXP]{\@@_sign_o:w} -% \begin{macro}[aux, EXP]{\@@_sign_aux_o:w} -% Find the sign of the floating point: \texttt{nan}, |+0|, |-0|, |+1| or |-1|. -% \begin{macrocode} -\cs_new:Npn \@@_sign_o:w ? \s_@@ \@@_chk:w #1#2; @ - { - \if_case:w #1 \exp_stop_f: - \@@_case_return_same_o:w - \or: \exp_after:wN \@@_sign_aux_o:w - \or: \exp_after:wN \@@_sign_aux_o:w - \else: \@@_case_return_same_o:w - \fi: - \s_@@ \@@_chk:w #1 #2; - } -\cs_new:Npn \@@_sign_aux_o:w \s_@@ \@@_chk:w #1 #2 #3 ; - { \@@_exp_after_o:w \s_@@ \@@_chk:w 1#2{1}{1000}{0000}{0000}{0000}; } -% \end{macrocode} -% \end{macro} -% \end{macro} -% % \begin{macro}[int, EXP]{\@@_not_o:w} % Return \texttt{true} or \texttt{false}, with two expansions, one to % exit the conditional, and one to please \pkg{l3fp-parse}. The first diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx index a25ce0967a0..1eba331f0fd 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx @@ -22,8 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-parse.dtx 6987 2017-03-11 01:06:52Z bruno $ - {L3 Floating-point expression parsing} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -655,12 +655,12 @@ { \exp_not:N \exp_after:wN \exp_not:N \@@_type_from_scan:w \exp_not:N \token_to_str:N #1 \exp_not:N \q_mark - \tl_to_str:n { s__fp _? } \exp_not:N \q_mark \exp_not:N \q_stop + \tl_to_str:n { s_@@ _? } \exp_not:N \q_mark \exp_not:N \q_stop } \use:x { \cs_new:Npn \exp_not:N \@@_type_from_scan:w - ##1 \tl_to_str:n { s__fp } ##2 \exp_not:N \q_mark ##3 \exp_not:N \q_stop + ##1 \tl_to_str:n { s_@@ } ##2 \exp_not:N \q_mark ##3 \exp_not:N \q_stop {##2} } % \end{macrocode} @@ -721,7 +721,8 @@ % % \begin{macro}[aux, EXP]{\@@_parse_one:Nw} % This function finds one number, and packs the symbol which follows -% in an |\..._infix_...| csname. |#1|~is the previous \meta{precedence}, +% in an \cs[no-index]{@@_parse_infix_\ldots{}} csname. +% |#1|~is the previous \meta{precedence}, % and |#2|~the first token of the operand. We distinguish four cases: % |#2|~is equal to \cs{scan_stop:} in meaning, |#2|~is a different % control sequence, |#2|~is a digit, and |#2|~is something else (this @@ -774,11 +775,11 @@ % \item \cs{s_@@_mark} is a premature end, we call % \cs{@@_exp_after_mark_f:nw}, which triggers an |fp-early-end| % error. -% \item For a control sequence not containing |\s__fp|, we call +% \item For a control sequence not containing \cs[no-index]{s_@@}, we call % \cs{@@_exp_after_?_f:nw}, causing a |bad-variable| error. % \end{itemize} % This scheme is extensible: additional types can be added by starting -% the variables with a scan mark of the form |\s__fp_|\meta{type} and +% the variables with a scan mark of the form \cs[no-index]{s_@@_\meta{type}} and % defining |\__fp_exp_after_|\meta{type}|_f:nw|. In all cases, we % make sure that the second argument of \cs{@@_parse_infix:NN} is % correctly expanded. @@ -809,22 +810,23 @@ \exp_after:wN \c_nan_fp \exp:w \exp_end_continue_f:w #1 } %<*package> -\group_begin: - \char_set_catcode_letter:N \@ - \cs_if_exist:NT \@unexpandable@protect - { - \cs_gset:cpn { @@_exp_after_?_f:nw } #1#2 - { - \exp_after:wN \c_nan_fp \exp:w \exp_end_continue_f:w #1 - \str_if_eq:nnTF {#2} { \protect } - { - \cs_if_eq:NNTF #2 \@unexpandable@protect { \use_i:nn } { \use:n } - { \__msg_kernel_expandable_error:nnn { kernel } { fp-robust-cmd } } - } - { \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#2} } - } - } -\group_end: +\cs_set_protected:Npn \@@_tmp:w #1 + { + \cs_if_exist:NT #1 + { + \cs_gset:cpn { @@_exp_after_?_f:nw } ##1##2 + { + \exp_after:wN \c_nan_fp \exp:w \exp_end_continue_f:w ##1 + \str_if_eq:nnTF {##2} { \protect } + { + \cs_if_eq:NNTF ##2 #1 { \use_i:nn } { \use:n } + { \__msg_kernel_expandable_error:nnn { kernel } { fp-robust-cmd } } + } + { \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {##2} } + } + } + } +\exp_args:Nc \@@_tmp:w { @unexpandable@protect } %</package> % \end{macrocode} % \end{macro} @@ -947,7 +949,7 @@ % % \begin{macro}[aux, EXP]{\@@_parse_one_other:NN} % For this function, |#2|~is a character token which is not a digit. -% If it is a letter, \cs{@@_parse_letters:N} beyond this one and give +% If it is an \textsc{ascii} letter, \cs{@@_parse_letters:N} beyond this one and give % the result to \cs{@@_parse_word:Nw}. Otherwise, the character is % assumed to be a prefix operator, and we build % |\__fp_parse_prefix_|\meta{operator}|:Nw|. @@ -1143,9 +1145,9 @@ % \end{macro} % % \begin{macro}[aux, EXP]{\@@_parse_zero:} -% After reading a significand of~$0$, we need to remove any exponent, -% then put a sign of~|1| for \cs{@@_sanitize:wN}, small hack to denote -% an exact zero (rather than an underflow). +% After reading a significand of~$0$, find any exponent, then put a +% sign of~|1| for \cs{@@_sanitize:wN}, which will remove everything +% and leave an exact zero. % \begin{macrocode} \cs_new:Npn \@@_parse_zero: { @@ -1771,9 +1773,11 @@ % Here, |#1| is a precedence, |#2| is some extra data used by some % functions, |#3| is \emph{e.g.}, \cs{@@_sin_o:w}, and expands once % after the calculation, |#4| is the operand, and |#5| is a -% |\__fp_parse_infix_...:N| function. We feed the data~|#2|, and the +% \cs[no-index]{@@_parse_infix_\ldots{}:N} function. We feed the data~|#2|, and the % argument~|#4|, to the function~|#3|, which expands % \cs{exp:w} thus the \texttt{infix} function~|#5|. +% +% This is redefined in \pkg{l3fp-extras}. % \begin{macrocode} \cs_new:Npn \@@_parse_apply_unary:NNNwN #1#2#3#4@#5 { @@ -1843,37 +1847,37 @@ % and leaves in the input stream the array it found as an operand, % fetching the following infix operator. % \begin{macrocode} -\group_begin: - \char_set_catcode_letter:N ( - \char_set_catcode_letter:N ) - \cs_new:Npn \@@_parse_prefix_(:Nw #1 - { - \exp_after:wN \@@_parse_lparen_after:NwN - \exp_after:wN #1 - \exp:w - \if_int_compare:w #1 = \c_@@_prec_funcii_int - \@@_parse_operand:Nw \c_@@_prec_comma_int - \else: - \@@_parse_operand:Nw \c_@@_prec_paren_int - \fi: - \@@_parse_expand:w - } - \cs_new:Npn \@@_parse_lparen_after:NwN #1#2 @ #3 - { - \token_if_eq_meaning:NNTF #3 \@@_parse_infix_):N - { - \@@_exp_after_array_f:w #2 \s_@@_stop - \exp_after:wN \@@_parse_infix:NN - \exp_after:wN #1 - \exp:w \@@_parse_expand:w - } - { - \__msg_kernel_expandable_error:nnn - { kernel } { fp-missing } { ) } - #2 @ \use_none:n #3 - } - } -\group_end: +\cs_new:cpn { @@_parse_prefix_(:Nw } #1 + { + \exp_after:wN \@@_parse_lparen_after:NwN + \exp_after:wN #1 + \exp:w + \if_int_compare:w #1 = \c_@@_prec_funcii_int + \@@_parse_operand:Nw \c_@@_prec_comma_int + \else: + \@@_parse_operand:Nw \c_@@_prec_paren_int + \fi: + \@@_parse_expand:w + } +\cs_new:Npx \@@_parse_lparen_after:NwN #1#2 @ #3 + { + \exp_not:N \token_if_eq_meaning:NNTF #3 + \exp_not:c { @@_parse_infix_):N } + { + \exp_not:N \@@_exp_after_array_f:w #2 \s_@@_stop + \exp_not:N \exp_after:wN + \exp_not:N \@@_parse_infix:NN + \exp_not:N \exp_after:wN #1 + \exp_not:N \exp:w + \exp_not:N \@@_parse_expand:w + } + { + \exp_not:N \__msg_kernel_expandable_error:nnn + { kernel } { fp-missing } { ) } + #2 @ + \exp_not:N \use_none:n #3 + } + } % \end{macrocode} % \end{macro} % @@ -1976,20 +1980,15 @@ % % ^^A begin[todo] % -% ^^A todo: test <15 digits>1500000000.1 -% ^^A todo: test <15 digits>1517263572.000 -% -% ^^A todo: word 'e' == 'invalid syntax', word 'E' == "use 'e' instead" -% % \begin{macro}[aux, EXP] -% {\@@_parse_unary_function:nNN, \@@_parse_function:NNN} +% {\@@_parse_unary_function:NNN, \@@_parse_function:NNN} % \begin{macrocode} -\cs_new:Npn \@@_parse_unary_function:nNN #1#2#3 +\cs_new:Npn \@@_parse_unary_function:NNN #1#2#3 { \exp_after:wN \@@_parse_apply_unary:NNNwN \exp_after:wN #3 \exp_after:wN #2 - \cs:w @@_#1_o:w \exp_after:wN \cs_end: + \exp_after:wN #1 \exp:w \@@_parse_operand:Nw \c_@@_prec_func_int \@@_parse_expand:w } @@ -2005,141 +2004,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[aux, EXP] -% { -% \@@_parse_word_acot:N , \@@_parse_word_acotd:N, -% \@@_parse_word_atan:N , \@@_parse_word_atand:N, -% \@@_parse_word_max:N , \@@_parse_word_min:N , -% \@@_parse_word_rand:N , \@@_parse_word_randint:N, -% } -% Those functions are also unary (not binary), but may receive a -% variable number of arguments. -% For |randint| we don't use the first argument~|?|. -% \begin{macrocode} -\cs_new:Npn \@@_parse_word_acot:N - { \@@_parse_function:NNN \@@_acot_o:Nw \use_i:nn } -\cs_new:Npn \@@_parse_word_acotd:N - { \@@_parse_function:NNN \@@_acot_o:Nw \use_ii:nn } -\cs_new:Npn \@@_parse_word_atan:N - { \@@_parse_function:NNN \@@_atan_o:Nw \use_i:nn } -\cs_new:Npn \@@_parse_word_atand:N - { \@@_parse_function:NNN \@@_atan_o:Nw \use_ii:nn } -\cs_new:Npn \@@_parse_word_max:N - { \@@_parse_function:NNN \@@_minmax_o:Nw 2 } -\cs_new:Npn \@@_parse_word_min:N - { \@@_parse_function:NNN \@@_minmax_o:Nw 0 } -\cs_new:Npn \@@_parse_word_rand:N - { \@@_parse_function:NNN \@@_rand_o:Nw ? } -\cs_new:Npn \@@_parse_word_randint:N - { \@@_parse_function:NNN \@@_randint_o:Nw ? } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[aux, EXP] -% { -% \@@_parse_word_abs:N , -% \@@_parse_word_exp:N , -% \@@_parse_word_ln:N , -% \@@_parse_word_sign:N , -% \@@_parse_word_sqrt:N , -% } -% Unary functions. -% \begin{macrocode} -\cs_new:Npn \@@_parse_word_abs:N - { \@@_parse_unary_function:nNN { set_sign } 0 } -\cs_new:Npn \@@_parse_word_exp:N - { \@@_parse_unary_function:nNN {exp} ? } -\cs_new:Npn \@@_parse_word_ln:N - { \@@_parse_unary_function:nNN {ln} ? } -\cs_new:Npn \@@_parse_word_sign:N - { \@@_parse_unary_function:nNN {sign} ? } -\cs_new:Npn \@@_parse_word_sqrt:N - { \@@_parse_unary_function:nNN {sqrt} ? } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[aux, EXP] -% { -% \@@_parse_word_acos:N , -% \@@_parse_word_acosd:N , -% \@@_parse_word_acsc:N , -% \@@_parse_word_acscd:N , -% \@@_parse_word_asec:N , -% \@@_parse_word_asecd:N , -% \@@_parse_word_asin:N , -% \@@_parse_word_asind:N , -% \@@_parse_word_cos:N , -% \@@_parse_word_cosd:N , -% \@@_parse_word_cot:N , -% \@@_parse_word_cotd:N , -% \@@_parse_word_csc:N , -% \@@_parse_word_cscd:N , -% \@@_parse_word_sec:N , -% \@@_parse_word_secd:N , -% \@@_parse_word_sin:N , -% \@@_parse_word_sind:N , -% \@@_parse_word_tan:N , -% \@@_parse_word_tand:N , -% } -% Unary functions. -% \begin{macrocode} -\tl_map_inline:nn - { - {acos} {acsc} {asec} {asin} - {cos} {cot} {csc} {sec} {sin} {tan} - } - { - \cs_new:cpn { @@_parse_word_#1:N } - { \@@_parse_unary_function:nNN {#1} \use_i:nn } - \cs_new:cpn { @@_parse_word_#1d:N } - { \@@_parse_unary_function:nNN {#1} \use_ii:nn } - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[aux, EXP] -% { -% \@@_parse_word_trunc:N, -% \@@_parse_word_floor:N, -% \@@_parse_word_ceil:N -% } -% \begin{macrocode} -\cs_new:Npn \@@_parse_word_trunc:N - { \@@_parse_function:NNN \@@_round_o:Nw \@@_round_to_zero:NNN } -\cs_new:Npn \@@_parse_word_floor:N - { \@@_parse_function:NNN \@@_round_o:Nw \@@_round_to_ninf:NNN } -\cs_new:Npn \@@_parse_word_ceil:N - { \@@_parse_function:NNN \@@_round_o:Nw \@@_round_to_pinf:NNN } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[aux, EXP]{\@@_parse_word_round:N, \@@_parse_round:Nw} -% \begin{macro}[aux, deprecated = 2017-12-31]{round+, round0, round-} -% This looks for |+|, |-|, |0| after |round|. That syntax is deprecated. -% \begin{macrocode} -\cs_new:Npn \@@_parse_word_round:N #1#2 - { - \if_meaning:w + #2 - \@@_parse_round:Nw \@@_round_to_pinf:NNN - \else: - \if_meaning:w 0 #2 - \@@_parse_round:Nw \@@_round_to_zero:NNN - \else: - \if_meaning:w - #2 - \@@_parse_round:Nw \@@_round_to_ninf:NNN - \fi: - \fi: - \fi: - \@@_parse_function:NNN - \@@_round_o:Nw \@@_round_to_nearest:NNN #1 - #2 - } -\cs_new:Npn \@@_parse_round:Nw - #1 #2 \@@_round_to_nearest:NNN #3#4 { #2 #1 #3 } -% \end{macrocode} -% \end{macro} -% \end{macro} -% % \subsection{Main functions} % % \begin{macro}[int, EXP]{\@@_parse:n} @@ -2185,11 +2049,9 @@ % % \begin{macro}[aux, EXP]{\@@_parse_operand:Nw} % \begin{macro}[aux, EXP]{\@@_parse_continue:NwN} -% The \cs{@@_parse_operand} -% This is just a shorthand which sets up both \cs{@@_parse_continue} -% and \cs{@@_parse_one} with the same precedence. Note the -% trailing \cs{exp:w}. This function should be -% used with much care. +% This is just a shorthand which sets up both \cs{@@_parse_continue:NwN} +% and \cs{@@_parse_one:Nw} with the same precedence. Note the +% trailing \cs{exp:w}. % \begin{macrocode} \cs_new:Npn \@@_parse_operand:Nw #1 { @@ -2210,6 +2072,8 @@ % Receives \meta{precedence} \meta{operand_1} |@| \meta{operation} % \meta{operand_2} |@| \meta{infix command}. Builds the appropriate % call to the \meta{operation}~|#3|. +% +% This is redefined in \pkg{l3fp-extras}. % \begin{macrocode} \cs_new:Npn \@@_parse_apply_binary:NwNwN #1 #2@ #3 #4@ #5 { @@ -2230,8 +2094,6 @@ \@@_exp_after_f:nw { \@@_parse_infix:NN #1 } #2; } -\group_begin: - \char_set_catcode_letter:N \* \cs_new:Npn \@@_parse_infix:NN #1 #2 { \if_catcode:w \scan_stop: \exp_not:N #2 @@ -2262,21 +2124,23 @@ #1 #2 } - \cs_new:Npn \@@_parse_infix_check:NNN #1#2#3 - { - \if_meaning:w \scan_stop: #1 - \__msg_kernel_expandable_error:nnn - { kernel } { fp-missing } { * } - \exp_after:wN \@@_parse_infix_*:N - \exp_after:wN #2 - \exp_after:wN #3 - \else: - \exp_after:wN #1 - \exp_after:wN #2 - \exp:w \exp_after:wN \@@_parse_expand:w - \fi: - } -\group_end: +\cs_new:Npx \@@_parse_infix_check:NNN #1#2#3 + { + \exp_not:N \if_meaning:w \scan_stop: #1 + \exp_not:N \__msg_kernel_expandable_error:nnn + { kernel } { fp-missing } { * } + \exp_not:N \exp_after:wN + \exp_not:c { @@_parse_infix_*:N } + \exp_not:N \exp_after:wN #2 + \exp_not:N \exp_after:wN #3 + \exp_not:N \else: + \exp_not:N \exp_after:wN #1 + \exp_not:N \exp_after:wN #2 + \exp_not:N \exp:w + \exp_not:N \exp_after:wN + \exp_not:N \@@_parse_expand:w + \exp_not:N \fi: + } % \end{macrocode} % \end{macro} % @@ -2306,22 +2170,23 @@ % an extra closing parenthesis if the previous operator was the % beginning of the expression. % \begin{macrocode} -\group_begin: - \char_set_catcode_letter:N \) - \cs_new:Npn \@@_parse_infix_):N #1 - { - \if_int_compare:w #1 < \c_@@_prec_paren_int - \__msg_kernel_expandable_error:nnn { kernel } { fp-extra } { ) } - \exp_after:wN \@@_parse_infix:NN - \exp_after:wN #1 - \exp:w \exp_after:wN \@@_parse_expand:w - \else: - \exp_after:wN @ - \exp_after:wN \use_none:n - \exp_after:wN \@@_parse_infix_):N - \fi: - } -\group_end: +\cs_set_protected:Npn \@@_tmp:w #1 + { + \cs_new:Npn #1 ##1 + { + \if_int_compare:w ##1 < \c_@@_prec_paren_int + \__msg_kernel_expandable_error:nnn { kernel } { fp-extra } { ) } + \exp_after:wN \@@_parse_infix:NN + \exp_after:wN ##1 + \exp:w \exp_after:wN \@@_parse_expand:w + \else: + \exp_after:wN @ + \exp_after:wN \use_none:n + \exp_after:wN #1 + \fi: + } + } +\exp_args:Nc \@@_tmp:w { @@_parse_infix_):N } % \end{macrocode} % \end{macro} % @@ -2331,44 +2196,49 @@ % \cs{@@_,_o:ww} is a complicated way of replacing any number of % floating point arguments by \texttt{nan}. % \begin{macrocode} -\group_begin: - \char_set_catcode_letter:N \, - \cs_new:Npn \@@_parse_infix_,:N #1 - { - \if_int_compare:w #1 > \c_@@_prec_comma_int - \exp_after:wN @ - \exp_after:wN \use_none:n - \exp_after:wN \@@_parse_infix_,:N - \else: - \if_int_compare:w #1 < \c_@@_prec_comma_int - \@@_parse_infix_comma_error:w +\cs_set_protected:Npn \@@_tmp:w #1 + { + \cs_new:Npn #1 ##1 + { + \if_int_compare:w ##1 > \c_@@_prec_comma_int + \exp_after:wN @ + \exp_after:wN \use_none:n + \exp_after:wN #1 + \else: + \if_int_compare:w ##1 < \c_@@_prec_comma_int + \@@_parse_infix_comma_error:w + \fi: + \exp_after:wN \@@_parse_infix_comma:w + \exp:w \@@_parse_operand:Nw \c_@@_prec_comma_int + \exp_after:wN \@@_parse_expand:w \fi: - \exp_after:wN \@@_parse_infix_comma:w - \exp:w \@@_parse_operand:Nw \c_@@_prec_comma_int - \exp_after:wN \@@_parse_expand:w - \fi: - } - \cs_new:Npn \@@_parse_infix_comma:w #1 @ - { #1 @ \use_none:n } - \cs_new:Npn \@@_parse_infix_comma_error:w #1 \exp:w - { - \fi: - \__msg_kernel_expandable_error:nn { kernel } { fp-extra-comma } - \exp_after:wN @ - \exp_after:wN \@@_parse_apply_binary:NwNwN - \exp_after:wN , - \exp:w - } - \cs_new:Npn \@@_,_o:ww #1 - { - \if_meaning:w \s_@@ #1 - \exp_after:wN \@@_use_i_until_s:nw - \exp_after:wN \@@_,_o:ww - \fi: - \exp_after:wN \c_nan_fp - #1 - } -\group_end: + } + } +\exp_args:Nc \@@_tmp:w { @@_parse_infix_,:N } +\cs_new:Npn \@@_parse_infix_comma:w #1 @ + { #1 @ \use_none:n } +\cs_new:Npn \@@_parse_infix_comma_error:w #1 \exp:w + { + \fi: + \__msg_kernel_expandable_error:nn { kernel } { fp-extra-comma } + \exp_after:wN @ + \exp_after:wN \@@_parse_apply_binary:NwNwN + \exp_after:wN , + \exp:w + } +\cs_set_protected:Npn \@@_tmp:w #1 + { + \cs_new:Npn #1 ##1 + { + \if_meaning:w \s_@@ ##1 + \exp_after:wN \@@_use_i_until_s:nw + \exp_after:wN #1 + \fi: + \exp_after:wN \c_nan_fp + ##1 + } + } +\exp_args:Nc \@@_tmp:w { @@_,_o:ww } % \end{macrocode} % \end{macro} % \end{macro} @@ -2382,53 +2252,46 @@ % \@@_parse_infix_/:N, \@@_parse_infix_mul:N, % \@@_parse_infix_and:N, \@@_parse_infix_or:N, % } -% \begin{macro}[aux, EXP]+\@@_parse_infix_^:N+ As described in the -% \enquote{work plan}, each infix operator has an associated -% |\..._infix_...| function, a computing function, and precedence, given as -% arguments to \cs{@@_tmp:w}. Using the general mechanism for -% arithmetic operations. The power operation must be associative in -% the opposite order from all others. For this, we use two distinct -% precedences. -% -% The odd requirement to set \cs{+} here is to cover the case where -% \pkg{expl3} is loaded by plain \TeX{}: \cs{+} is an \cs{outer} macro there, -% and so the following code would otherwise give an error in that case. -% \begin{macrocode} -\group_begin: -%<*package> - \cs_set:Npn \+ { } -%</package> - \char_set_catcode_other:N \& - \char_set_catcode_letter:N \^ - \char_set_catcode_letter:N \/ - \char_set_catcode_letter:N \- - \char_set_catcode_letter:N \+ - \cs_set_protected:Npn \@@_tmp:w #1#2#3#4 - { - \cs_new:Npn #1 ##1 - { - \if_int_compare:w ##1 < #3 - \exp_after:wN @ - \exp_after:wN \@@_parse_apply_binary:NwNwN - \exp_after:wN #2 - \exp:w - \@@_parse_operand:Nw #4 - \exp_after:wN \@@_parse_expand:w - \else: - \exp_after:wN @ - \exp_after:wN \use_none:n - \exp_after:wN #1 - \fi: - } - } - \@@_tmp:w \@@_parse_infix_^:N ^ \c_@@_prec_hatii_int \c_@@_prec_hat_int - \@@_tmp:w \@@_parse_infix_/:N / \c_@@_prec_times_int \c_@@_prec_times_int - \@@_tmp:w \@@_parse_infix_mul:N * \c_@@_prec_times_int \c_@@_prec_times_int - \@@_tmp:w \@@_parse_infix_-:N - \c_@@_prec_plus_int \c_@@_prec_plus_int - \@@_tmp:w \@@_parse_infix_+:N + \c_@@_prec_plus_int \c_@@_prec_plus_int - \@@_tmp:w \@@_parse_infix_and:N & \c_@@_prec_and_int \c_@@_prec_and_int - \@@_tmp:w \@@_parse_infix_or:N | \c_@@_prec_or_int \c_@@_prec_or_int -\group_end: +% \begin{macro}[aux, EXP]+\@@_parse_infix_^:N+ +% As described in the \enquote{work plan}, each infix operator has an +% associated |\..._infix_...| function, a computing function, and +% precedence, given as arguments to \cs{@@_tmp:w}. Using the general +% mechanism for arithmetic operations. The power operation must be +% associative in the opposite order from all others. For this, we use +% two distinct precedences. +% \begin{macrocode} +\cs_set_protected:Npn \@@_tmp:w #1#2#3#4 + { + \cs_new:Npn #1 ##1 + { + \if_int_compare:w ##1 < #3 + \exp_after:wN @ + \exp_after:wN \@@_parse_apply_binary:NwNwN + \exp_after:wN #2 + \exp:w + \@@_parse_operand:Nw #4 + \exp_after:wN \@@_parse_expand:w + \else: + \exp_after:wN @ + \exp_after:wN \use_none:n + \exp_after:wN #1 + \fi: + } + } +\exp_args:Nc \@@_tmp:w { @@_parse_infix_^:N } ^ + \c_@@_prec_hatii_int \c_@@_prec_hat_int +\exp_args:Nc \@@_tmp:w { @@_parse_infix_/:N } / + \c_@@_prec_times_int \c_@@_prec_times_int +\exp_args:Nc \@@_tmp:w { @@_parse_infix_mul:N } * + \c_@@_prec_times_int \c_@@_prec_times_int +\exp_args:Nc \@@_tmp:w { @@_parse_infix_-:N } - + \c_@@_prec_plus_int \c_@@_prec_plus_int +\exp_args:Nc \@@_tmp:w { @@_parse_infix_+:N } + + \c_@@_prec_plus_int \c_@@_prec_plus_int +\exp_args:Nc \@@_tmp:w { @@_parse_infix_and:N } & + \c_@@_prec_and_int \c_@@_prec_and_int +\exp_args:Nc \@@_tmp:w { @@_parse_infix_or:N } | + \c_@@_prec_or_int \c_@@_prec_or_int % \end{macrocode} % \end{macro} % \end{macro} @@ -2473,7 +2336,7 @@ { \if_catcode:w ^ \tl_to_str:n { #3 #5 } ^ \else: - \@@_error:nffn { invalid-ii } + \@@_error:nffn { fp-invalid-ii } { \@@_array_to_clist:n { #2; #3 } } { \@@_array_to_clist:n { #4; #5 } } { } @@ -2487,54 +2350,44 @@ % % \begin{macro}[aux, EXP]{\@@_parse_infix_*:N} % \begin{macrocode} -\group_begin: - \char_set_catcode_letter:N ^ - \cs_new:cpn { @@_parse_infix_*:N } #1#2 - { - \if:w * \exp_not:N #2 - \exp_after:wN \@@_parse_infix_^:N - \exp_after:wN #1 - \else: - \exp_after:wN \@@_parse_infix_mul:N - \exp_after:wN #1 - \exp_after:wN #2 - \fi: - } -\group_end: +\cs_set_protected:Npn \@@_tmp:w #1 + { + \cs_new:cpn { @@_parse_infix_*:N } ##1##2 + { + \if:w * \exp_not:N ##2 + \exp_after:wN #1 + \exp_after:wN ##1 + \else: + \exp_after:wN \@@_parse_infix_mul:N + \exp_after:wN ##1 + \exp_after:wN ##2 + \fi: + } + } +\exp_args:Nc \@@_tmp:w { @@_parse_infix_^:N } % \end{macrocode} % \end{macro} % % \begin{macro}[aux, EXP]+\@@_parse_infix_|:Nw+ % \begin{macro}[aux, EXP]+\@@_parse_infix_&:Nw+ % \begin{macrocode} -\group_begin: - \char_set_catcode_letter:N \| - \char_set_catcode_letter:N \& - \cs_new:Npn \@@_parse_infix_|:N #1#2 - { - \if:w | \exp_not:N #2 - \exp_after:wN \@@_parse_infix_|:N - \exp_after:wN #1 - \exp:w \exp_after:wN \@@_parse_expand:w - \else: - \exp_after:wN \@@_parse_infix_or:N - \exp_after:wN #1 - \exp_after:wN #2 - \fi: - } - \cs_new:Npn \@@_parse_infix_&:N #1#2 - { - \if:w & \exp_not:N #2 - \exp_after:wN \@@_parse_infix_&:N - \exp_after:wN #1 - \exp:w \exp_after:wN \@@_parse_expand:w - \else: - \exp_after:wN \@@_parse_infix_and:N - \exp_after:wN #1 - \exp_after:wN #2 - \fi: - } -\group_end: +\cs_set_protected:Npn \@@_tmp:w #1#2#3 + { + \cs_new:Npn #1 ##1##2 + { + \if:w #2 \exp_not:N ##2 + \exp_after:wN #1 + \exp_after:wN ##1 + \exp:w \exp_after:wN \@@_parse_expand:w + \else: + \exp_after:wN #3 + \exp_after:wN ##1 + \exp_after:wN ##2 + \fi: + } + } +\exp_args:Nc \@@_tmp:w { @@_parse_infix_|:N } | \@@_parse_infix_or:N +\exp_args:Nc \@@_tmp:w { @@_parse_infix_&:N } & \@@_parse_infix_and:N % \end{macrocode} % \end{macro} % \end{macro} @@ -2543,39 +2396,32 @@ % % \begin{macro}[aux, EXP]{\@@_parse_infix_?:N, \@@_parse_infix_::N} % \begin{macrocode} -\group_begin: - \char_set_catcode_letter:N \? - \cs_new:Npn \@@_parse_infix_?:N #1 - { - \if_int_compare:w #1 < \c_@@_prec_quest_int - \exp_after:wN @ - \exp_after:wN \@@_ternary:NwwN - \exp:w - \@@_parse_operand:Nw \c_@@_prec_quest_int - \exp_after:wN \@@_parse_expand:w - \else: - \exp_after:wN @ - \exp_after:wN \use_none:n - \exp_after:wN \@@_parse_infix_?:N - \fi: - } - \cs_new:Npn \@@_parse_infix_::N #1 - { - \if_int_compare:w #1 < \c_@@_prec_quest_int - \__msg_kernel_expandable_error:nnnn - { kernel } { fp-missing } { ? } { ~for~?: } - \exp_after:wN @ - \exp_after:wN \@@_ternary_auxii:NwwN - \exp:w - \@@_parse_operand:Nw \c_@@_prec_colon_int - \exp_after:wN \@@_parse_expand:w - \else: - \exp_after:wN @ - \exp_after:wN \use_none:n - \exp_after:wN \@@_parse_infix_::N - \fi: - } -\group_end: +\cs_set_protected:Npn \@@_tmp:w #1#2#3#4 + { + \cs_new:Npn #1 ##1 + { + \if_int_compare:w ##1 < \c_@@_prec_quest_int + #4 + \exp_after:wN @ + \exp_after:wN #2 + \exp:w + \@@_parse_operand:Nw #3 + \exp_after:wN \@@_parse_expand:w + \else: + \exp_after:wN @ + \exp_after:wN \use_none:n + \exp_after:wN #1 + \fi: + } + } +\exp_args:Nc \@@_tmp:w { @@_parse_infix_?:N } + \@@_ternary:NwwN \c_@@_prec_quest_int { } +\exp_args:Nc \@@_tmp:w { @@_parse_infix_::N } + \@@_ternary_auxii:NwwN \c_@@_prec_colon_int + { + \__msg_kernel_expandable_error:nnnn + { kernel } { fp-missing } { ? } { ~for~?: } + } % \end{macrocode} % \end{macro} % @@ -2631,11 +2477,7 @@ \cs_new:Npn \@@_parse_compare_auxi:NNNNNNN #1#2#3#4#5#6#7 { \if_case:w - \if_catcode:w \scan_stop: \exp_not:N #7 - 4 \exp_stop_f: - \else: - \__int_eval:w `#7 - `< \__int_eval_end: - \fi: + \__int_eval:w \exp_after:wN ` \token_to_str:N #7 - `< \__int_eval_end: \@@_parse_compare_auxii:NNNNN #2#2#4#5#6 \or: \@@_parse_compare_auxii:NNNNN #2#3#2#5#6 \or: \@@_parse_compare_auxii:NNNNN #2#3#4#2#6 @@ -2823,6 +2665,8 @@ % \subsection{Messages} % % \begin{macrocode} +\__msg_kernel_new:nnn { kernel } { fp-deprecated } + { '#1'~deprecated;~use~'#2' } \__msg_kernel_new:nnn { kernel } { unknown-fp-word } { Unknown~fp~word~#1. } \__msg_kernel_new:nnn { kernel } { fp-missing } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx index c5da3f78998..90c4f9a2176 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-random.dtx Copyright (C) 2016 The LaTeX3 Project +%% File: l3fp-random.dtx Copyright (C) 2016,2017 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 @@ -22,8 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-random.dtx 6943 2017-02-17 16:47:59Z bruno $ - {L3 Floating-point random numbers} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -62,6 +62,17 @@ %<@@=fp> % \end{macrocode} % +% \begin{macro}[aux, EXP]{\@@_parse_word_rand:N , \@@_parse_word_randint:N} +% Those functions may receive a variable number of arguments. We +% won't use the argument~|?|. +% \begin{macrocode} +\cs_new:Npn \@@_parse_word_rand:N + { \@@_parse_function:NNN \@@_rand_o:Nw ? } +\cs_new:Npn \@@_parse_word_randint:N + { \@@_parse_function:NNN \@@_randint_o:Nw ? } +% \end{macrocode} +% \end{macro} +% % \subsection{Engine support} % % At present, \XeTeX{}, \pTeX{} and \upTeX{} do not provide random diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx index 31a0ba85783..37ae94e798d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-round.dtx Copyright(C) 2011-2012,2014-2016 The LaTeX3 Project +%% File: l3fp-round.dtx Copyright(C) 2011-2012,2014-2017 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 @@ -22,8 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-round.dtx 6968 2017-02-20 16:08:44Z bruno $ - {L3 Floating-point rounding} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -71,6 +71,63 @@ % ^^A todo: optimize all rounding functions for various rounding modes. % ^^A todo: reduce the number of almost identical functions. % +% \begin{macro}[aux, EXP] +% { +% \@@_parse_word_trunc:N, +% \@@_parse_word_floor:N, +% \@@_parse_word_ceil:N +% } +% \begin{macrocode} +\cs_new:Npn \@@_parse_word_trunc:N + { \@@_parse_function:NNN \@@_round_o:Nw \@@_round_to_zero:NNN } +\cs_new:Npn \@@_parse_word_floor:N + { \@@_parse_function:NNN \@@_round_o:Nw \@@_round_to_ninf:NNN } +\cs_new:Npn \@@_parse_word_ceil:N + { \@@_parse_function:NNN \@@_round_o:Nw \@@_round_to_pinf:NNN } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[aux, EXP] +% { +% \@@_parse_word_round:N, \@@_parse_round:Nw, +% \@@_parse_round_deprecation_error:Nw +% } +% \begin{macro}[aux, deprecated = 2017-12-31]{round+, round0, round-} +% This looks for |+|, |-|, |0| after |round|. That syntax is deprecated. +% \begin{macrocode} +\cs_new:Npn \@@_parse_word_round:N #1#2 + { + \if_meaning:w + #2 + \@@_parse_round:Nw \@@_round_to_pinf:NNN + \else: + \if_meaning:w 0 #2 + \@@_parse_round:Nw \@@_round_to_zero:NNN + \else: + \if_meaning:w - #2 + \@@_parse_round:Nw \@@_round_to_ninf:NNN + \fi: + \fi: + \fi: + \@@_parse_function:NNN + \@@_round_o:Nw \@@_round_to_nearest:NNN #1 + #2 + } +\cs_new:Npn \@@_parse_round:Nw + #1 #2 \@@_round_to_nearest:NNN #3#4 { #2 #1 #3 } +\cs_new:Npn \@@_parse_round_deprecation_error:Nw + #1 #2 \@@_round_to_nearest:NNN #3#4 + { + \@@_error:nnfn { fp-deprecated } { round#4() } + { + \str_case:nn {#2} + { { + } { ceil } { 0 } { trunc } { - } { floor } } + } { } + #2 #1 #3 + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \subsection{Rounding tools} % % \begin{variable}{\c_@@_five_int} @@ -344,7 +401,6 @@ % % ^^A todo: This macro is intermingled with l3fp-parse. % ^^A todo: Add explanations. -% ^^A todo: This macro f-expands rather than o-expands after itself, is that an issue? % \begin{macro}[aux,EXP]{\@@_round_o:Nw} % The |trunc|, |ceil| and |floor| functions expect one or two % arguments (the second is $0$ by default), and the |round| function @@ -361,7 +417,7 @@ \or: \@@_round:Nww #1 #2 \exp:w \else: \@@_round:Nwww #1 #2 @ \exp:w \fi: - \exp_end_continue_f:w + \exp_after:wN \exp_end: } % \end{macrocode} % \end{macro} @@ -371,9 +427,9 @@ \cs_new:Npn \@@_round_no_arg_o:Nw #1 { \cs_if_eq:NNTF #1 \@@_round_to_nearest:NNN - { \@@_error:nnnn { num-args } { round () } { 1 } { 3 } } + { \@@_error:nnnn { fp-num-args } { round () } { 1 } { 3 } } { - \@@_error:nffn { num-args } + \@@_error:nffn { fp-num-args } { \@@_round_name_from_cs:N #1 () } { 1 } { 2 } } \exp_after:wN \c_nan_fp @@ -404,12 +460,12 @@ #2 ; #3 ; } { - \@@_error:nnnn { num-args } { round () } { 1 } { 3 } + \@@_error:nnnn { fp-num-args } { round () } { 1 } { 3 } \exp_after:wN \c_nan_fp } } { - \@@_error:nffn { num-args } + \@@_error:nffn { fp-num-args } { \@@_round_name_from_cs:N #1 () } { 1 } { 2 } \exp_after:wN \c_nan_fp } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx index 685274306b0..f1f1ae61f60 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-traps.dtx Copyright (C) 2011-2014,2016 The LaTeX3 Project +%% File: l3fp-traps.dtx Copyright (C) 2011-2014,2016,2017 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 @@ -22,8 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-traps.dtx 6923 2017-02-14 03:07:25Z bruno $ - {L3 Floating-point exception trapping} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -166,7 +166,7 @@ { \cs_set:Npn \@@_invalid_operation:nnw ##1##2##3; } { #1 - \@@_error:nnfn { invalid } {##2} { \fp_to_tl:n { ##3; } } { } + \@@_error:nnfn { fp-invalid } {##2} { \fp_to_tl:n { ##3; } } { } \flag_raise:n { fp_invalid_operation } ##1 } @@ -174,7 +174,7 @@ { \cs_set:Npn \@@_invalid_operation_o:Nww ##1##2; ##3; } { #1 - \@@_error:nffn { invalid-ii } + \@@_error:nffn { fp-invalid-ii } { \fp_to_tl:n { ##2; } } { \fp_to_tl:n { ##3; } } {##1} \flag_raise:n { fp_invalid_operation } \exp_after:wN \c_nan_fp @@ -183,7 +183,7 @@ { \cs_set:Npn \@@_invalid_operation_tl_o:ff ##1##2 } { #1 - \@@_error:nffn { invalid } {##1} {##2} { } + \@@_error:nffn { fp-invalid } {##1} {##2} { } \flag_raise:n { fp_invalid_operation } \exp_after:wN \c_nan_fp } @@ -216,7 +216,7 @@ { \cs_set:Npn \@@_division_by_zero_o:Nnw ##1##2##3; } { #1 - \@@_error:nnfn { zero-div } {##2} { \fp_to_tl:n { ##3; } } { } + \@@_error:nnfn { fp-zero-div } {##2} { \fp_to_tl:n { ##3; } } { } \flag_raise:n { fp_division_by_zero } \exp_after:wN ##1 } @@ -224,7 +224,7 @@ { \cs_set:Npn \@@_division_by_zero_o:NNww ##1##2##3; ##4; } { #1 - \@@_error:nffn { zero-div-ii } + \@@_error:nffn { fp-zero-div-ii } { \fp_to_tl:n { ##3; } } { \fp_to_tl:n { ##4; } } {##2} \flag_raise:n { fp_division_by_zero } \exp_after:wN ##1 @@ -285,7 +285,7 @@ { #1 \@@_error:nffn - { flow \if_meaning:w 1 ##1 -to \fi: } + { fp-flow \if_meaning:w 1 ##1 -to \fi: } { \fp_to_tl:n { \s_@@ \@@_chk:w ##1##2##3; } } { \token_if_eq_meaning:NNF 0 ##2 { - } #4 } {#2} @@ -337,15 +337,13 @@ % % \subsection{Errors} % -%^^A begin[todo] % \begin{macro}[int, EXP]{\@@_error:nnnn, \@@_error:nnfn, \@@_error:nffn} % \begin{macrocode} -\cs_new:Npn \@@_error:nnnn #1 - { \__msg_kernel_expandable_error:nnnnn { kernel } { fp - #1 } } +\cs_new:Npn \@@_error:nnnn + { \__msg_kernel_expandable_error:nnnnn { kernel } } \cs_generate_variant:Nn \@@_error:nnnn { nnf, nff } % \end{macrocode} % \end{macro} -% ^^A end[todo] % % \subsection{Messages} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx index af5b1b478c7..30e849c2711 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-trig.dtx Copyright (C) 2011-2014,2016 The LaTeX3 Project +%% File: l3fp-trig.dtx Copyright (C) 2011-2014,2016,2017 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 @@ -22,8 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-trig.dtx 6943 2017-02-17 16:47:59Z bruno $ - {L3 Floating-point trigonometric functions} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -62,7 +62,70 @@ %<@@=fp> % \end{macrocode} % -%^^A todo: check EXP/rEXP everywhere. +% \begin{macro}[aux, EXP] +% { +% \@@_parse_word_acos:N , +% \@@_parse_word_acosd:N , +% \@@_parse_word_acsc:N , +% \@@_parse_word_acscd:N , +% \@@_parse_word_asec:N , +% \@@_parse_word_asecd:N , +% \@@_parse_word_asin:N , +% \@@_parse_word_asind:N , +% \@@_parse_word_cos:N , +% \@@_parse_word_cosd:N , +% \@@_parse_word_cot:N , +% \@@_parse_word_cotd:N , +% \@@_parse_word_csc:N , +% \@@_parse_word_cscd:N , +% \@@_parse_word_sec:N , +% \@@_parse_word_secd:N , +% \@@_parse_word_sin:N , +% \@@_parse_word_sind:N , +% \@@_parse_word_tan:N , +% \@@_parse_word_tand:N , +% } +% Unary functions. +% \begin{macrocode} +\tl_map_inline:nn + { + {acos} {acsc} {asec} {asin} + {cos} {cot} {csc} {sec} {sin} {tan} + } + { + \cs_new:cpx { @@_parse_word_#1:N } + { + \exp_not:N \@@_parse_unary_function:NNN + \exp_not:c { @@_#1_o:w } + \exp_not:N \use_i:nn + } + \cs_new:cpx { @@_parse_word_#1d:N } + { + \exp_not:N \@@_parse_unary_function:NNN + \exp_not:c { @@_#1_o:w } + \exp_not:N \use_ii:nn + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[aux, EXP] +% { +% \@@_parse_word_acot:N , \@@_parse_word_acotd:N, +% \@@_parse_word_atan:N , \@@_parse_word_atand:N, +% } +% Those functions may receive a variable number of arguments. +% \begin{macrocode} +\cs_new:Npn \@@_parse_word_acot:N + { \@@_parse_function:NNN \@@_acot_o:Nw \use_i:nn } +\cs_new:Npn \@@_parse_word_acotd:N + { \@@_parse_function:NNN \@@_acot_o:Nw \use_ii:nn } +\cs_new:Npn \@@_parse_word_atan:N + { \@@_parse_function:NNN \@@_atan_o:Nw \use_i:nn } +\cs_new:Npn \@@_parse_word_atand:N + { \@@_parse_function:NNN \@@_atan_o:Nw \use_ii:nn } +% \end{macrocode} +% \end{macro} % % \subsection{Direct trigonometric functions} % @@ -101,7 +164,7 @@ % reduction and if necessary convert the reduced argument to radians. % Then, \cs{@@_sin_series_o:NNwwww} will be called to compute the % Taylor series: this function receives a sign~|#3|, an initial octant -% of~$0$, and the function \cs{@@_ep_to_float:wwN} which converts the +% of~$0$, and the function \cs{@@_ep_to_float_o:wwN} which converts the % result of the series to a floating point directly rather than taking % its inverse, since $\sin(x) = \#3 \sin\lvert x\rvert$. % \begin{macrocode} @@ -112,7 +175,7 @@ \or: \@@_case_use:nw { \@@_trig:NNNNNwn #1 \@@_sin_series_o:NNwwww - \@@_ep_to_float:wwN #3 0 + \@@_ep_to_float_o:wwN #3 0 } \or: \@@_case_use:nw { \@@_invalid_operation_o:fw { #1 { sin } { sind } } } @@ -139,7 +202,7 @@ \or: \@@_case_use:nw { \@@_trig:NNNNNwn #1 \@@_sin_series_o:NNwwww - \@@_ep_to_float:wwN 0 2 + \@@_ep_to_float_o:wwN 0 2 } \or: \@@_case_use:nw { \@@_invalid_operation_o:fw { #1 { cos } { cosd } } } @@ -169,7 +232,7 @@ \or: \@@_case_use:nw { \@@_trig:NNNNNwn #1 \@@_sin_series_o:NNwwww - \@@_ep_inv_to_float:wwN #3 0 + \@@_ep_inv_to_float_o:wwN #3 0 } \or: \@@_case_use:nw { \@@_invalid_operation_o:fw { #1 { csc } { cscd } } } @@ -195,7 +258,7 @@ \or: \@@_case_use:nw { \@@_trig:NNNNNwn #1 \@@_sin_series_o:NNwwww - \@@_ep_inv_to_float:wwN 0 2 + \@@_ep_inv_to_float_o:wwN 0 2 } \or: \@@_case_use:nw { \@@_invalid_operation_o:fw { #1 { sec } { secd } } } @@ -280,7 +343,7 @@ % what trigonometric function we compute, and |#6| to~|#8| are pieces % of a normal floating point number. Call the \texttt{_series} % function~|#2|, with arguments |#3|, either a conversion function -% (\cs{@@_ep_to_float:wN} or \cs{@@_ep_inv_to_float:wN}) or a sign $0$ +% (\cs{@@_ep_to_float_o:wN} or \cs{@@_ep_inv_to_float_o:wN}) or a sign $0$ % or~$2$ when computing tangent or cotangent; |#4|, a sign $0$ or~$2$; % the octant, computed in an integer expression starting with~|#5| and % stopped by a period; and a fixed point number obtained from the @@ -796,8 +859,8 @@ % % \begin{macro}[aux, EXP] % {\@@_sin_series_o:NNwwww, \@@_sin_series_aux_o:NNnwww} -% Here we receive a conversion function \cs{@@_ep_to_float:wwN} or -% \cs{@@_ep_inv_to_float:wwN}, a \meta{sign} ($0$ or~$2$), a +% Here we receive a conversion function \cs{@@_ep_to_float_o:wwN} or +% \cs{@@_ep_inv_to_float_o:wwN}, a \meta{sign} ($0$ or~$2$), a % (non-negative) \meta{octant} delimited by a dot, a \meta{fixed % point} number delimited by a semicolon, and an extended-precision % number. The auxiliary receives: @@ -954,7 +1017,7 @@ { \exp_after:wN \@@_sanitize:Nw \exp_after:wN #1 - \__int_value:w \__int_eval:w \@@_ep_to_float:wwN + \__int_value:w \__int_eval:w \@@_ep_to_float_o:wwN } #1 } @@ -1123,7 +1186,7 @@ \exp_after:wN #2 \__int_value:w \__int_eval:w \if_meaning:w 2 #5 7 - \fi: #3 \exp_after:wN ; - \c_@@_one_fixed_tl ; + \c_@@_one_fixed_tl {0000}{0000}{0000}{0000}{0000}{0000}; 0,{0000}{0000}{0000}{0000}{0000}{0000}; #1 } @@ -1262,7 +1325,7 @@ \if_int_compare:w #1 = -1 \exp_stop_f: \@@_atan_Taylor_break:w \fi: - \exp_after:wN \@@_fixed_div_int:wwN \c_@@_one_fixed_tl ; #1; + \exp_after:wN \@@_fixed_div_int:wwN \c_@@_one_fixed_tl #1; \@@_rrot:www \@@_fixed_mul_sub_back:wwwn #2; #3; { \exp_after:wN \@@_atan_Taylor_loop:www @@ -1299,7 +1362,7 @@ % z}{z}$ with $|#4|=z$, then compute the appropriate multiple of % $\frac{\pi}{4}$ and add or subtract the product $|#3|\cdot|#4|$. In % both cases, convert to a floating point with -% \cs{@@_fixed_to_float:wN}. +% \cs{@@_fixed_to_float_o:wN}. % \begin{macrocode} \cs_new:Npn \@@_atan_combine_o:NwwwwwN #1 #2; #3; #4; #5,#6; #7 { @@ -1319,7 +1382,7 @@ \__int_value:w \__int_eval:w #2 / 2 ; #2; } } - { #7 \@@_fixed_to_float:wN \@@_fixed_to_float_rad:wN } + { #7 \@@_fixed_to_float_o:wN \@@_fixed_to_float_rad_o:wN } #1 } \cs_new:Npn \@@_atan_combine_aux:ww #1; #2; @@ -1398,12 +1461,12 @@ % \end{macro} % % \begin{macro}[aux, EXP]{\@@_asin_normal_o:NfwNnnnnw} -% If the exponent~|#5| is strictly less than~$1$, the operand lies +% If the exponent~|#5| is at most $0$, the operand lies % within $(-1,1)$ and the operation is permitted: call -% \cs{@@_asin_auxi_o:nNww} with the appropriate arguments. If the +% \cs{@@_asin_auxi_o:NnNww} with the appropriate arguments. If the % number is exactly~$\pm 1$ (the test works because we know that % $|#5|\geq 1$, $|#6#7|\geq 10000000$, $|#8#9|\geq 0$, with equality -% only for $\pm 1$), we also call \cs{@@_asin_auxi_o:nNww}. +% only for $\pm 1$), we also call \cs{@@_asin_auxi_o:NnNww}. % Otherwise, \cs{@@_use_i:ww} gets rid of the \texttt{asin} auxiliary, % and raises instead an invalid operation, because the operand is % outside the domain of arcsine or arccosine. @@ -1456,7 +1519,7 @@ } \cs_new:Npn \@@_asin_isqrt:wn #1; { - \exp_after:wN \@@_fixed_sub:wwn \c_@@_one_fixed_tl ; #1; + \exp_after:wN \@@_fixed_sub:wwn \c_@@_one_fixed_tl #1; { \@@_fixed_add_one:wN #1; \@@_fixed_continue:wn { \@@_ep_mul:wwwwn 0, } 0, @@ -1526,7 +1589,7 @@ % If the exponent is non-positive, the operand is less than~$1$ in % absolute value, which is always an invalid operation: complain. % Otherwise, compute the inverse of the operand, and feed it to -% \cs{@@_asin_auxi_o:nNww} (with all the appropriate arguments). This +% \cs{@@_asin_auxi_o:NnNww} (with all the appropriate arguments). This % computes what we want thanks to % $\operatorname{acsc}(x)=\operatorname{asin}(1/x)$ and % $\operatorname{asec}(x)=\operatorname{acos}(1/x)$. diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx index 5fdc2ebde85..50b474bcf08 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3fp.dtx 6987 2017-03-11 01:06:52Z bruno $ - {L3 Floating points} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \usepackage{amsmath} \begin{document} \DocInput{\jobname.dtx} @@ -728,19 +724,17 @@ % % We support four types of floating point numbers: % \begin{itemize} -% \item $\pm 0.d_1d_2\ldots{}d_{16} \cdot 10^{n}$, a normal floating -% point number, with $d_i\in [0,9]$, $d_1\neq 0$, and $\lvert n\rvert -% \leq \ExplSyntaxOn \int_use:N \c__fp_max_exponent_int$; +% \item $\pm m \cdot 10^{n}$, a floating +% point number, with integer $1\leq m\leq 10^{16}$, and +% $-{\ExplSyntaxOn\int_use:N\c__fp_minus_min_exponent_int}\leq +% n\leq {\ExplSyntaxOn\int_use:N\c__fp_max_exponent_int}$; % \item $\pm 0$, zero, with a given sign; % \item $\pm \infty$, infinity, with a given sign; % \item \nan{}, is \enquote{not a number}, and can be either quiet % or signalling (\emph{not yet}: this distinction is currently % unsupported); -% \item [\emph{(not yet)}] subnormal numbers $\pm 0.d_1d_2\ldots{}d_{16} -% \cdot 10^{-\ExplSyntaxOn\int_use:N \c__fp_max_exponent_int}$ with -% $d_1=0$. % \end{itemize} -% Normal floating point numbers are stored in base $10$, with $16$ +% Normal floating point numbers are stored in base $10$, with up to $16$ % significant figures. % % On input, a normal floating point number consists of: @@ -1322,7 +1316,7 @@ % \pkg{Pgfmath} also provides box-measurements (depth, height, width), but % boxes are not possible expandably. % -% Bugs. (Exclamation points mark important bugs.) +% Bugs. % \begin{itemize} % \item Check that functions are monotonic when they should. % \item Add exceptions to |?:|, |!<=>?|, |&&|, \verb"||", and |!|. @@ -1334,8 +1328,6 @@ % \item \texttt{0e9999999999} gives a \TeX{} \enquote{number too % large} error. % \item Subnormals are not implemented. -% \item The overflow trap receives the wrong argument in -% \pkg{l3fp-expo} (see |exp(1e5678)| in \file{m3fp-traps001}). % \end{itemize} % % Possible optimizations/improvements. @@ -1370,8 +1362,7 @@ % \TeX{} fp packages, the international standards,\ldots{} % \item Also take into account the \enquote{inexact} exception? % \item Support multi-character prefix operators (\emph{e.g.}, |@/| or -% whatever)? Perhaps for including comments inside the computation -% itself?? +% whatever)? % \end{itemize} % % \end{documentation} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx index bc5675b9a9d..2a6491ee4c1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3int.dtx 6949 2017-02-18 16:04:10Z joseph $ - {L3 Integers} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx index e437fcfe1d1..ad9379a0056 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3keys.dtx 6906 2017-02-12 20:07:58Z bruno $ - {L3 Key-value interfaces} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx index 90d9ceb11ae..22b2e49c523 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package&tex> -\GetIdInfo$Id: l3luatex.dtx 6953 2017-02-18 19:07:54Z joseph $ - {L3 Experimental LuaTeX-specific functions} -%</driver|package&tex> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx index 1c67bad74fa..b68e9cc88c4 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3msg.dtx Copyright (C) 2009-2016 The LaTeX3 Project +%% File: l3msg.dtx Copyright (C) 2009-2017 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 @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3msg.dtx 6966 2017-02-20 03:39:43Z bruno $ - {L3 Messages} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx index 013d5bf0546..8ea4a9076de 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3names.dtx 6962 2017-02-19 22:58:35Z joseph $ - {L3 Namespace for primitives} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx b/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx index 1bba6465684..4a65779f968 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx @@ -21,7 +21,7 @@ % for those people who are interested. % %<*driver|oldmodules> -\def\ExplFileDate{2017/03/11} +\def\ExplFileDate{2017/03/18} %</driver|oldmodules> %<*driver> \documentclass[full]{l3doc} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx index 9ed983c9afb..7339862d22d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3prg.dtx 6906 2017-02-12 20:07:58Z bruno $ - {L3 Control structures} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx index 290d45e463e..74947ccfcf7 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3prop.dtx 6906 2017-02-12 20:07:58Z bruno $ - {L3 Property lists} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx index 90c38e62699..a7806e65949 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3quark.dtx Copyright (C) 1990-2016 The LaTeX3 Project +%% File: l3quark.dtx Copyright (C) 1990-2017 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 @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3quark.dtx 6947 2017-02-17 21:27:18Z bruno $ - {L3 Quarks} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx index b78874e1227..c6e1f555ce7 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3seq.dtx 6967 2017-02-20 14:51:30Z bruno $ - {L3 Sequences and stacks} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx index 8bc399e2d24..2b2c04d66ca 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx @@ -23,12 +23,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3skip.dtx 6968 2017-02-20 16:08:44Z bruno $ - {L3 Dimensions and skips} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx index 5307712d1c4..5e08f62a9f0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3sort.dtx 6967 2017-02-20 14:51:30Z bruno $ - {L3 Sorting functions} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx index ef628bab6a3..eff946bda28 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3str.dtx 6967 2017-02-20 14:51:30Z bruno $ - {L3 Strings} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -1787,4 +1783,4 @@ % % \end{implementation} % -% \PrintIndex
\ No newline at end of file +% \PrintIndex diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx index a664fbd67da..9522383ced6 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3sys.dtx 6976 2017-02-22 16:49:53Z stonezeng $ - {L3 Experimental system/runtime functions} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx index d3bffb0668a..bba4b3cf18e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3tl.dtx 6967 2017-02-20 14:51:30Z bruno $ - {L3 Token lists} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx index cfae476c2df..3a69760aa64 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3token.dtx Copyright (C) 2005-2016 The LaTeX3 Project +%% File: l3token.dtx Copyright (C) 2005-2017 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 @@ -22,12 +22,8 @@ % %<*driver> \documentclass[full]{l3doc} -%</driver> -%<*driver|package> -\GetIdInfo$Id: l3token.dtx 6967 2017-02-20 14:51:30Z bruno $ - {L3 Experimental token manipulation} -%</driver|package> -%<*driver> +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} \begin{document} \DocInput{\jobname.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx index 6468a2e6c06..70eecd7ac77 100644 --- a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx +++ b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx @@ -23,8 +23,8 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2017/03/11] -%<package>\@ifpackagelater{expl3}{2017/03/11} +\RequirePackage{expl3}[2017/03/18] +%<package>\@ifpackagelater{expl3}{2017/03/18} %<package> {} %<package> {% %<package> \PackageError{l3keys2e}{Support package l3kernel too old} @@ -36,10 +36,8 @@ %<package> }% %<package> \endinput %<package> } -\def\ExplFileName{l3keys2e} -\def\ExplFileDescription{LaTeX2e option processing using LaTeX3 keys} -\def\ExplFileDate{2017/03/11} -\def\ExplFileVersion{6988} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -137,8 +135,8 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\ProvidesExplPackage{l3keys2e}{\ExplFileDate}{\ExplFileVersion} + {LaTeX2e option processing using LaTeX3 keys} % \end{macrocode} % % Non-standard variants. diff --git a/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx b/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx index cc1e0bb571f..2bb8aa846bc 100644 --- a/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx @@ -23,8 +23,8 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2017/03/11] -%<package>\@ifpackagelater{expl3}{2017/03/11} +\RequirePackage{expl3}[2017/03/18] +%<package>\@ifpackagelater{expl3}{2017/03/18} %<package> {} %<package> {% %<package> \PackageError{xfpu}{Support package l3kernel too old} @@ -37,10 +37,8 @@ %<package> \endinput %<package> } %<package>\RequirePackage{xparse} -\def\ExplFileName{xfp} -\def\ExplFileDescription{LaTeX Floating Point Unit} -\def\ExplFileDate{2017/03/11} -\def\ExplFileVersion{6988} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -149,8 +147,8 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\ProvidesExplPackage{xfp}{\ExplFileDate}{\ExplFileVersion} + {L3 Floating point unit} % \end{macrocode} % % \begin{macro}{\fpeval} diff --git a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx index 363cbbd9460..ba55e15d35d 100644 --- a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx @@ -24,8 +24,8 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2017/03/11] -%<package>\@ifpackagelater{expl3}{2017/03/11} +\RequirePackage{expl3}[2017/03/18] +%<package>\@ifpackagelater{expl3}{2017/03/18} %<package> {} %<package> {% %<package> \PackageError{xfrac}{Support package l3kernel too old} @@ -38,10 +38,8 @@ %<package> \endinput %<package> } \RequirePackage{amstext,graphicx,l3keys2e,textcomp,xparse,xtemplate} -\def\ExplFileName{xfrac} -\def\ExplFileDescription{L3 Experimental split-level fractions} -\def\ExplFileDate{2017/03/11} -\def\ExplFileVersion{6988} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -539,8 +537,8 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\ProvidesExplPackage{xfrac}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental split-level fractions} % \end{macrocode} % % \begin{variable}{\l_@@_cm_std_bool} diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx index 06a424ba694..733cc3dcff8 100644 --- a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx @@ -27,8 +27,8 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2017/03/11] -%<package>\@ifpackagelater{expl3}{2017/03/11} +\RequirePackage{expl3}[2017/03/18] +%<package>\@ifpackagelater{expl3}{2017/03/18} %<package> {} %<package> {% %<package> \PackageError{xparse}{Support package l3kernel too old} @@ -40,10 +40,8 @@ %<package> }% %<package> \endinput %<package> } -\def\ExplFileName{xparse} -\def\ExplFileDescription{L3 Experimental document command parser} -\def\ExplFileDate{2017/03/11} -\def\ExplFileVersion{6988} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -782,8 +780,8 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\ProvidesExplPackage{xparse}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental document command parser} % \end{macrocode} % % \subsection{Variables and constants} @@ -844,9 +842,8 @@ % % \begin{variable}{\l_@@_defaults_bool, \l_@@_defaults_tl} % The boolean indicates whether there are any argument with default -% value; the token list holds the code to determine these default -% values in terms of other arguments, and dummy code for arguments -% that do not need a default. +% value other than |-NoValue-|; the token list holds the code to +% determine these default values in terms of other arguments. % \begin{macrocode} \bool_new:N \l_@@_defaults_bool \tl_new:N \l_@@_defaults_tl @@ -1380,7 +1377,7 @@ \@@_if_no_value:nTF {#2} { \tl_put_right:Nx \l_@@_tmpa_tl - { { \exp_not:N \exp_not:n { \exp_not:o { \use_none:n #3 } } } } + { { \exp_not:N \exp_not:n { \exp_not:o {#3} } } } } { \tl_put_right:Nn \l_@@_tmpa_tl @@ -1500,7 +1497,7 @@ } { \@@_if_no_value:nTF {#2} - { \exp_args:No \@@_end_expandable_defaults:nw { \use_none:n #1 } } + { \exp_args:No \@@_end_expandable_defaults:nw {#1} } { \@@_end_expandable_defaults:nw {#2} } } } @@ -2052,7 +2049,7 @@ \bool_set_true:N \l_@@_prefixed_bool \bool_set_true:N \l_@@_process_some_bool \int_decr:N \l_@@_current_arg_int - \tl_put_right:Nn \l_@@_process_one_tl { {#1} } + \tl_put_left:Nn \l_@@_process_one_tl { {#1} } \@@_prepare_signature_bypass:N } % \end{macrocode} @@ -2262,40 +2259,40 @@ % \begin{macro}{\@@_add_default:n, \@@_add_default:, \@@_add_default_E:nn} % \begin{macro}[aux]{\@@_add_default_E_aux:n} % Store the default value of an argument, or rather code that gives -% that default value (it may involve other arguments). Defaults are -% always stored with a leading |.| except for \texttt{E}-type -% arguments, to distinguish them. For \texttt{E}-type arguments, pad -% the defaults |#2| with some |{-NoValue-}| until there are the same -% numbers as embellishments~|#1|. Then for technical reasons make -% sure the first default is wrapped in braces. These functions are -% also used when defining expandable commands. +% that default value (it may involve other arguments). This is +% \cs{c_@@_no_value_tl} for arguments with no actual default or with +% default |-NoValue-|; \cs{prg_do_nothing:} followed by a default +% value for most others, and a token list of braced arguments for +% \texttt{E}-type arguments. For \texttt{E}-type arguments, pad the +% defaults |#2| with some |{-NoValue-}| until there are as many as +% embellishments~|#1|. These functions are also used when defining +% expandable commands. % \begin{macrocode} \cs_new_protected:Npn \@@_add_default:n #1 { - \bool_set_true:N \l_@@_defaults_bool - \tl_put_right:Nn \l_@@_defaults_tl { { . #1} } + \@@_if_no_value:nTF {#1} + { \@@_add_default: } + { + \bool_set_true:N \l_@@_defaults_bool + \tl_put_right:Nn \l_@@_defaults_tl { { \prg_do_nothing: #1 } } + } } \cs_new_protected:Npn \@@_add_default: - { \tl_put_right:Nn \l_@@_defaults_tl { . } } + { \tl_put_right:Nn \l_@@_defaults_tl { \c_@@_no_value_tl } } \cs_new_protected:Npn \@@_add_default_E:nn #1#2 { \bool_set_true:N \l_@@_defaults_bool - \tl_set:Nx \l_@@_tmpa_tl - { - \exp_not:n {#2} - \prg_replicate:nn - { \tl_count:n {#1} - \tl_count:n {#2} } - { { \c_@@_no_value_tl } } - } \tl_put_right:Nx \l_@@_defaults_tl { { - \exp_not:f - { \exp_after:wN \@@_add_default_E_aux:n \l_@@_tmpa_tl } + \tl_map_function:nN {#2} \@@_add_default_E_aux:n + \prg_replicate:nn + { \tl_count:n {#1} - \tl_count:n {#2} } + { { \c_@@_no_value_tl } } } } } -\cs_new:Npn \@@_add_default_E_aux:n #1 { {#1} } +\cs_new:Npn \@@_add_default_E_aux:n #1 { \exp_not:n { {#1} } } % \end{macrocode} % \end{macro} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx index d4a436f4c09..666d5135ee8 100644 --- a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx @@ -27,8 +27,8 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2017/03/11] -%<package>\@ifpackagelater{expl3}{2017/03/11} +\RequirePackage{expl3}[2017/03/18] +%<package>\@ifpackagelater{expl3}{2017/03/18} %<package> {} %<package> {% %<package> \PackageError{xtemplate}{Support package l3kernel too old} @@ -40,10 +40,8 @@ %<package> }% %<package> \endinput %<package> } -\def\ExplFileName{xtemplate} -\def\ExplFileDescription{L3 Experimental prototype document functions} -\def\ExplFileDate{2017/03/11} -\def\ExplFileVersion{6988} +\def\ExplFileDate{2017/03/18} +\def\ExplFileVersion{7019} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -688,8 +686,8 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\ProvidesExplPackage{xtemplate}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental prototype document functions} % \end{macrocode} % % \subsection{Variables and constants} |