summaryrefslogtreecommitdiff
path: root/macros/generic/poormanlog/poormanlog.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/generic/poormanlog/poormanlog.tex')
-rw-r--r--macros/generic/poormanlog/poormanlog.tex142
1 files changed, 2 insertions, 140 deletions
diff --git a/macros/generic/poormanlog/poormanlog.tex b/macros/generic/poormanlog/poormanlog.tex
index e29c208901..f1faa66547 100644
--- a/macros/generic/poormanlog/poormanlog.tex
+++ b/macros/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