summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint/xintlog.sty
blob: 0ba983d2530b79ec7b64f660e5f28065d877232e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
%%
%% This is file `xintlog.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xint.dtx  (with options: `xintlog')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from xintlog.sty.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file xint.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
%% The xint bundle 1.3e 2019/04/05
%% Copyright (C) 2013-2019 by Jean-Francois Burnol
%% xintlog: Logarithms and exponentials for xintexpr
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \catcode94=7    % ^
  \def\z{\endgroup}%
  \def\empty{}\def\space{ }\newlinechar10
  \expandafter\let\expandafter\w\csname ver@xintexpr.sty\endcsname
  \expandafter\let\expandafter\x\csname ver@xintlog.sty\endcsname
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info:^^J%
                 \space\space\space\space#2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \expandafter
  \ifx\csname numexpr\endcsname\relax
     \y{xintlog}{\numexpr not available, aborting input}%
     \aftergroup\endinput
  \else
    \ifx\w\relax % xintexpr.sty not yet loaded.
        \y{xintlog}%
          {Loading should be via \ifx\x\empty\string\usepackage{xintexpr.sty}
                          \else\string\input\space xintexpr.sty \fi
           rather, aborting}%
        \aftergroup\endinput
    \else
      \ifx\x\relax % first loading (initiated from xintexpr.sty)
      \else
        \ifx\x\empty % LaTeX first loading, \ProvidesPackage not yet seen
        \else
          \y{xintlog}{Already loaded, aborting}%
          \aftergroup\endinput
        \fi
      \fi
    \fi
  \fi
\z%
\xintexprSafeCatcodes\catcode`_ 11
\XINT_providespackage
\ProvidesPackage{xintlog}%
[2019/04/05 1.3e Logarithms and exponentials for xintexpr (JFB)]%
\ifdefined\RequirePackage
  \RequirePackage{poormanlog}%
\else
  \input poormanlog.tex
\fi
\xintexprRestoreCatcodes\csname XINT_setcatcodes\endcsname\catcode`\! 11
\def\xintLog#1{\xintMul{\PoorManLogBaseTen{#1}}{23025850923[-10]}}%
\def\XINTinFloatLog#1{\XINTinFloatMul{\PoorManLogBaseTen{#1}}{23025850923[-10]}}%
\def\xintExp#1{\PoorManPowerOfTen{\xintMul{#1}{434294481903[-12]}}}%
\def\XINTinFloatExp#1{\PoorManPowerOfTen{\XINTinFloatMul{#1}{434294481903[-12]}}}%
\def\XINT_expr_func_log #1#2#3%
{%
    \expandafter #1\expandafter #2\csname.=%
    \XINT:NEhook:one\xintLog{\XINT_expr_unlock #3}\endcsname
}%
\def\XINT_flexpr_func_log #1#2#3%
{%
    \expandafter #1\expandafter #2\csname.=%
    \XINT:NEhook:one\XINTinFloatLog{\XINT_expr_unlock #3}\endcsname
}%
\def\XINT_expr_func_exp #1#2#3%
{%
    \expandafter #1\expandafter #2\csname.=%
    \XINT:NEhook:one\xintExp{\XINT_expr_unlock #3}\endcsname
}%
\def\XINT_flexpr_func_exp #1#2#3%
{%
    \expandafter #1\expandafter #2\csname.=%
    \XINT:NEhook:one\XINTinFloatExp{\XINT_expr_unlock #3}\endcsname
}%
\def\XINT_expr_func_pow #1#2#3%
{%
    \expandafter #1\expandafter #2\csname.=%
    \expandafter\XINT:NEhook:twosp
    \romannumeral`&&@\XINT_expr_unlock #3,!\PoorManPower
    \endcsname
}%
\let\XINT_flexpr_func_pow\XINT_expr_func_pow
\endinput
%%
%% End of file `xintlog.sty'.