summaryrefslogtreecommitdiff
path: root/macros/generic/poormanlog/README
blob: cb250c4adf8a4c2fbe85b8c9cef13bde0f1dbc42 (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
POORMANLOG (v0.05, 2019/04/22)
==============================

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.

It can be used with TeX (\input poormanlog) and has a LaTeX interface
(\usepackage{poormanlog}).

Regarding TeX, it requires the e-TeX \numexpr primitive, thus etex
or pdftex or other binaries with the e-TeX extensions are required.


Changes
-------

- 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.

- v0.05 (2019/04/22): the additions/patches to xint originally
  provided by poormanlog.tex got moved into xint 1.3f itself.

  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.


Files
-----

poormanlog.tex
poormanlog.sty
README


\PMLogZ{#1} computes base-10 logarithms:
----------------------------------------

expansion: the argument is submitted to f-expansion and the macro
           itself expands fully in two steps.

input:  #1 must be (or f-expands to) a mantissa ddddddddd with exactly
        9 digits, standing for D = d.dddddddd, 1 <= D < 10

output: 9 digits xxxxxxxxx standing for X = 0.xxxxxxxxx such that
        log10(D) is about X

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*).


\PMPowTen{#1} computes fractional powers of 10:
-----------------------------------------------

expansion: the argument is submitted to f-expansion and the macro
           itself expands fully in two steps.

input:  #1 must be (f-expands to) exactly 9 digits xxxxxxxxx, standing
        for X = 0.xxxxxxxxx

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)

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
-------

Copyright (C) 2019, Jean-Francois Burnol.

This Work may be distributed and/or modified under the conditions of the
LaTeX Project Public License version 1.3c. This version of this license
is in

    <http://www.latex-project.org/lppl/lppl-1-3c.txt>

and version 1.3 or later is part of all distributions of LaTeX version
2005/12/01 or later.

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 this
README.