summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/generic/poormanlog/README153
-rw-r--r--Master/texmf-dist/tex/generic/poormanlog/poormanlog.sty4
-rw-r--r--Master/texmf-dist/tex/generic/poormanlog/poormanlog.tex142
3 files changed, 56 insertions, 243 deletions
diff --git a/Master/texmf-dist/doc/generic/poormanlog/README b/Master/texmf-dist/doc/generic/poormanlog/README
index fc5f096fdc5..cb250c4adf8 100644
--- a/Master/texmf-dist/doc/generic/poormanlog/README
+++ b/Master/texmf-dist/doc/generic/poormanlog/README
@@ -1,126 +1,77 @@
-DOCUMENTATION OF POORMANLOG (v0.04, 2019/02/17)
-===========================
+POORMANLOG (v0.05, 2019/04/22)
+==============================
-(see License at bottom of this file)
+poormanlog.tex provides (expandable) macros \PMLogZ and \PMPowTen
+for computing base 10 logarithms and powers of 10 with a bit less
+than 9 digits of precision.
-The poormanlog.tex file has no dependencies. It provides (expandable)
-macros for base 10 logarithms and powers of 10 with a bit less than 9
-digits of precision (\PMLogZ and \PMPowTen), but its main use will be
-in conjunction with xintexpr.sty, as it provides to the latter
-functions log10() and pow10() and does on-demand modification of the
-power operators ** or ^ to compute according to pow10(y*log10(x)).
+It can be used with TeX (\input poormanlog) and has a LaTeX interface
+(\usepackage{poormanlog}).
-This usage will become obsolete when xintexpr will natively implement
-in arbitrary precision the log10() and pow10() functions.
+Regarding TeX, it requires the e-TeX \numexpr primitive, thus etex
+or pdftex or other binaries with the e-TeX extensions are required.
-The file can be used with Plain TeX (\input poormanlog) or as a
-regular LaTeX package.
+Changes
+-------
-Example (with Plain TeX)
-------------------------
-
- \input xintexpr.sty
- \input poormanlog.tex
-
- \xinteval{log10(3.14159265), pow10(2.71828183)}
-
- \poormanloghack{**}
-
- \xinteval{3.14159265**2.71828183}
-
- \poormanloghack{^}
-
- \xinteval{3.14159265^2.71828183}
-
- \bye
-
-
-User interface
---------------
-
-\PMLogZ{#1} expands in two steps.
-
-input: #1 is a mantissa ddddddddd (it may be an f-expandable macro)
- with exactly 9 digits (the first one must not be zero)
-output: 9 digits xxxxxxxxx such that log10(d.dddddddd) is about 0.xxxxxxxxx
-
-It seems from testing that absolute error is not much more than 1 unit in
-the last place, and result differs from rounded mathematical value by at
-most 1 unit in the 9th digit. (attention not rigorously proven).
-
-\PMPowTen{#1} expands in two steps.
-
-input: #1 is (or expands to) exactly 9 digits ddddddddd representing
- 0.ddddddddd
-output: 9 digits xxxxxxxxx, first one not zero,
- such that 10^0.ddddddddd is about x.xxxxxxxx
-
-It seems from testing that absolute error is less than 2 units in
-the last place, and result differs from rounded mathematical value by at
-most 2 units in the 9th digit. (attention not rigorously proven).
-
-\PoorManLogBaseTen{#1}
-
- in presence of xintfrac this will accept input as recognized by xintfrac
- and produce the logarithm in base 10 with an error (believed to be at
- most) about 1 unit in the 9th (i.e. last) fractional digit.
-
- xintfrac may be loaded before or after.
-
-\PoorManPowerOfTen{#1}
-
- in presence of package xintfrac this will accept input as recognized by
- xintfrac and produce the 10^#1 with 9 digits of float precision, with an
- error (believed to be) at most 2 units in the last place. Of course for
- this the input must be precise enough to have 9 fractional digits of
- **fixed point** precision.
+- v0.04 (2019/02/17): initial release. The package has no
+ dependencies and alongside two macros \PMLogZ and \PMPowTen
+ also provides some specific additions to xint.
- xintfrac may be loaded before or after.
+- v0.05 (2019/04/22): the additions/patches to xint originally
+ provided by poormanlog.tex got moved into xint 1.3f itself.
-\PoorManPower{#1}{#2}
+ Thus, poormanlog now reduces to the sole two macros
+ \PMLogZ and \PMPowTen. It can be imported by other macro
+ files with no danger of conflicting with future releases of
+ xint in case of concurrent usage.
- in presence of package xintfrac computes #1 to the power #2
- xintfrac may be loaded before or after.
+Files
+-----
-log10()
+poormanlog.tex
+poormanlog.sty
+README
- the log10() function is made available, if xintexpr.sty is loaded, for
- usage within \xinteval and \xintfloateval. If a log10() function is
- already defined in xintexpr it will not be overwritten
- xintexpr may be loaded before or after.
+\PMLogZ{#1} computes base-10 logarithms:
+----------------------------------------
-pow10()
+expansion: the argument is submitted to f-expansion and the macro
+ itself expands fully in two steps.
- pow10() function is made available, if xintexpr.sty is loaded, for usage
- within \xinteval and \xintfloateval. If a pow10() function is already
- defined in xintexpr it will not be overwritten
+input: #1 must be (or f-expands to) a mantissa ddddddddd with exactly
+ 9 digits, standing for D = d.dddddddd, 1 <= D < 10
- xintexpr may be loaded before or after.
+output: 9 digits xxxxxxxxx standing for X = 0.xxxxxxxxx such that
+ log10(D) is about X
-modification of ** or ^ operators in \xintexpr and \xintfloatexpr
+precision: It seems from testing that absolute error is not much
+ more than 1 unit in the last place, and result X differs
+ from rounded mathematical value of log10(D) by at most
+ 1 unit in the last place.
+ (*attention estimate not rigorously proven*).
- \poormanloghack{**}
- \poormanloghack{^}
- They will now use pow10(y*log10(x)) formula to compute x to the power y
+\PMPowTen{#1} computes fractional powers of 10:
+-----------------------------------------------
- Of course this means drop of precision, but allows non-integer exponents.
- (half-integer exponents are already accepted in \xintfloatexpr natively).
+expansion: the argument is submitted to f-expansion and the macro
+ itself expands fully in two steps.
- ** xintexpr must have been loaded before **
+input: #1 must be (f-expands to) exactly 9 digits xxxxxxxxx, standing
+ for X = 0.xxxxxxxxx
-Example with LaTeX :
+output: 9 digits ddddddddd, such that D = d.dddddddd is about 10^X
+ The first digit of output is never zero (i.e. 1 <= D < 10)
- \documentclass{article}
- \usepackage{xintexpr}
- \usepackage{poormanlog}% makes log10() and pow10() available
- \poormanloghack{**} % modifies ** operator
- \begin{document}
- \xinteval{3.14159265**2.71828183, log10(3.14159265), pow10(2.71828)}
- \end{document}
+precision: It seems from testing that absolute error is less than
+ 2 units in the last place, and result D differs from
+ rounded mathematical value of 10^X by at most 2 units in
+ the last place.
+ (*attention estimate not rigorously proven*).
LICENSE
@@ -141,5 +92,5 @@ This Work has the LPPL maintenance status `author-maintained'.
The Author of this Work is Jean-Francois Burnol.
-This Work consists of files poormanlog.tex, poormanlog.sty and the
+This Work consists of files poormanlog.tex, poormanlog.sty and this
README.
diff --git a/Master/texmf-dist/tex/generic/poormanlog/poormanlog.sty b/Master/texmf-dist/tex/generic/poormanlog/poormanlog.sty
index c740360e985..e164999faa1 100644
--- a/Master/texmf-dist/tex/generic/poormanlog/poormanlog.sty
+++ b/Master/texmf-dist/tex/generic/poormanlog/poormanlog.sty
@@ -1,4 +1,4 @@
-%% poormanlog.sty v0.04, 2019/02/17
+%% poormanlog.sty v0.05, 2019/04/22
%%
%% Copyright (C) 2019, Jean-Francois Burnol
%%
@@ -12,6 +12,6 @@
%% This Work consists of files poormanlog.tex, poormanlog.sty and
%% the accompanying README
%%
-\ProvidesPackage{poormanlog}[2019/02/17 v0.04 log and powers with 9 digits (JFB)]
+\ProvidesPackage{poormanlog}[2019/04/22 v0.05 base 10 log and pow with 9 digits (JFB)]
\input{poormanlog.tex}% see README file for user documentation
\endinput
diff --git a/Master/texmf-dist/tex/generic/poormanlog/poormanlog.tex b/Master/texmf-dist/tex/generic/poormanlog/poormanlog.tex
index e29c2089010..f1faa665479 100644
--- a/Master/texmf-dist/tex/generic/poormanlog/poormanlog.tex
+++ b/Master/texmf-dist/tex/generic/poormanlog/poormanlog.tex
@@ -1,4 +1,4 @@
-%% poormanlog.tex v0.04, 2019/02/17
+%% poormanlog.tex v0.05, 2019/04/22
%%
%% Copyright (C) 2019, Jean-Francois Burnol
%%
@@ -12,11 +12,6 @@
%% This Work consists of files poormanlog.tex, poormanlog.sty and the
%% README
%%
-%% ************ BARELY TESTED ****************
-%% >>>>>>> WARNING FOR LACK OF TIME I HAVE NOT YET VALIDATED FULLY <<<<<
-%% >>>>>>> NOR HAVE I MADE PRECISE ESTIMATES. USE AT YOUR OWN RISK <<<<<
-%% (bug reports welcome)
-%% ************ BARELY TESTED ****************
%
% Package macro private prefix: \PML@
%
@@ -35,7 +30,7 @@
\catcode`\noexpand\^ \the\catcode`\^ %
\catcode`\noexpand\: \the\catcode`\: %
\catcode`\noexpand\* \the\catcode`\* %
- \catcode`\noexpand\@ \the\catcode`\@ %
+ \catcode`\noexpand\@ \the\catcode`\@\relax
}%
\catcode`\@ 11 %
\if1\ifx\@namedef\JFBUundefined1\else\ifx\@namedef\relax1\else0\fi\fi
@@ -284,138 +279,5 @@
\the\numexpr1000000000+\expandafter\PML@\romannumeral-`0#1.\relax
}%
\def\PMPowTen#1{\the\numexpr\expandafter\PML@Pa\romannumeral-`0#1.\relax}%
-%%
-%%
-%% ADD-ONS TO XINTFRAC : \PoorManLogBaseTen{#1}, \PoorManPowerOfTen{#1}
-%% and \PoorManPower{#1}{#2}
-%% Does not matter if xintfrac loaded before or after.
-%%
-\def\PoorManLogBaseTen{\romannumeral0\poormanlogbaseten}%
-\def\poormanlogbaseten #1%
- {\expandafter\PML@logbaseten\romannumeral0\XINTinfloat[9]{#1}}%
-\def\PML@logbaseten#1[#2]%
-{%
- \xintiiadd{\xintDSx{-9}{\the\numexpr#2+8\relax}}{\the\numexpr\PML@#1.}%
- [-9]%
-}%
-%
-\def\PoorManPowerOfTen{\the\numexpr\poormanpoweroften}%
-\def\poormanpoweroften #1%
- {\expandafter\PML@powoften\romannumeral0\xintraw{#1}}%
-\catcode`\_ 11 %
-\def\PML@powoften#1{%
- \xint_UDzerominusfork
- #1-\PML@powoften@zero
- 0#1\PML@powoften@neg
- 0-\PML@powoften@pos
- \krof #1%
-}%
-\catcode`\_ 8 %
-\def\PML@powoften@zero 0{1\relax}%/1[0]
-\def\PML@powoften@pos#1[#2]{%
- \expandafter\PML@powoften@pos@a\romannumeral0\xintround{9}{#1[#2]}.%
-}%
-\def\PML@powoften@pos@a#1.#2.{\PML@Pa#2.\expandafter[\the\numexpr-8+#1]}%
-\def\PML@powoften@neg#1[#2]{%
- \expandafter\PML@powoften@neg@a\romannumeral0\xintround{9}{#1[#2]}.%
-}%
-\def\PML@powoften@neg@a#1.#2.{\ifnum#2=0 \xint_afterfi{1\relax/1[#1]}\else
- \expandafter\expandafter\expandafter
- \PML@Pa\expandafter\@gobble\the\numexpr2000000000-#2.%
- \expandafter[\the\numexpr-9+#1\expandafter]\fi
-}%
-%
-\def\PoorManPower#1#2% #1**#2
-{%
- \PoorManPowerOfTen{\xintMul{#2}{\PoorManLogBaseTen{#1}}}%
-}%
-%%
-%% ADD-ONS TO XINTEXPR :
-%%
-%% log10(), pow10()
-%%
-%% Does not matter if xintexpr loaded before or after.
-%%
-\catcode`\_ 11 \catcode`\: 11 %
-\unless\ifcsname XINT_expr_func_log10\endcsname
-\@namedef{XINT_expr_func_log10}#1#2#3%
-{%
- \expandafter #1\expandafter #2\csname.=%
- \XINT:NEhook:one\PoorManLogBaseTen{\XINT_expr_unlock #3}\endcsname
-}%
-\fi
-\unless\ifcsname XINT_flexpr_func_log10\endcsname
-\expandafter\let\csname XINT_flexpr_func_log10\expandafter\endcsname
- \csname XINT_expr_func_log10\endcsname
-\fi
-%
-\unless\ifcsname XINT_expr_func_pow10\endcsname
-\@namedef{XINT_expr_func_pow10}#1#2#3%
-{%
- \expandafter #1\expandafter #2\csname.=%
- \XINT:NEhook:one\PoorManPowerOfTen{\XINT_expr_unlock #3}\endcsname
-}%
-\fi
-\unless\ifcsname XINT_flexpr_func_pow10\endcsname
-\expandafter\let\csname XINT_flexpr_func_pow10\expandafter\endcsname
- \csname XINT_expr_func_pow10\endcsname
-\fi
-%%
-%% On-demand modification of ** or ^ operators in \xintexpr and \xintfloatexpr
-%%
-\catcode`\* 11 \catcode0 12 %
-%
-\def\poormanloghack**{%
-\def\XINT_expr_op_** ##1%
-{%
- \expandafter \XINT_expr_until_**_a
- \expandafter ##1\romannumeral`^^@\expandafter\XINT_expr_getnext
-}%
-\def\XINT_expr_until_**_a ##1{%
-\def\XINT_expr_until_**_a ####1####2%
-{%
- \xint_UDsignfork
- ####2{\expandafter \XINT_expr_until_**_a \expandafter ##1%
- \romannumeral`^^@##1}%
- -{\XINT_expr_until_**_b ####1####2}%
- \krof
-}}\expandafter\XINT_expr_until_**_a\csname XINT_expr_op_-ix\endcsname
-\def\XINT_expr_until_**_b ##1##2##3##4%
-{%
- \ifnum ##2>\XINT_expr_precedence_**
- \xint_afterfi
- {\expandafter \XINT_expr_until_**_a \expandafter ##1%
- \romannumeral`^^@\csname XINT_expr_op_##3\endcsname {##4}}%
- \else
- \xint_afterfi
- {\expandafter ##2\expandafter ##3%
- \csname .=\XINT:NEhook:two
- \PoorManPower{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname
- }%
- \fi
-}%
-\let\XINT_flexpr_op_** \XINT_expr_op_**
-\let\XINT_flexpr_until_**_a\XINT_expr_until_**_a
-\let\XINT_flexpr_until_**_b\XINT_expr_until_**_b
-}%
-\catcode`\^ 11 \catcode`\* 7 %
-\def\poormanloghack^{%
-\def\XINT_expr_until_^_b ##1##2##3##4%
-{%
- \ifnum ##2>\XINT_expr_precedence_^
- \xint_afterfi
- {\expandafter \XINT_expr_until_^_a \expandafter ##1%
- \romannumeral`**@\csname XINT_expr_op_##3\endcsname {##4}}%
- \else
- \xint_afterfi
- {\expandafter ##2\expandafter ##3%
- \csname .=\XINT:NEhook:two
- \PoorManPower{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname
- }%
- \fi
-}%
-\let\XINT_flexpr_until_^_b\XINT_expr_until_^_b
-}%
\@tempa
-\def\poormanloghack#1{\csname poormanloghack#1\endcsname}%
\endinput