summaryrefslogtreecommitdiff
path: root/macros/generic
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-04-22 03:01:24 +0000
committerNorbert Preining <norbert@preining.info>2021-04-22 03:01:24 +0000
commit39a0cee90a81b676f789f5599ec8a4fb5e5bbd52 (patch)
treefaf2913f7ccf3bbc24ac92ee459f1b773c64d944 /macros/generic
parent20788e2817af7ef0b25395c161b06e7a1446b8b1 (diff)
CTAN sync 202104220301
Diffstat (limited to 'macros/generic')
-rw-r--r--macros/generic/poormanlog/README40
1 files changed, 29 insertions, 11 deletions
diff --git a/macros/generic/poormanlog/README b/macros/generic/poormanlog/README
index cb250c4adf..c98b99894d 100644
--- a/macros/generic/poormanlog/README
+++ b/macros/generic/poormanlog/README
@@ -1,9 +1,9 @@
-POORMANLOG (v0.05, 2019/04/22)
+POORMANLOG (v0.06, 2021/04/21)
==============================
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.
+than 9 digits of (fixed point) precision.
It can be used with TeX (\input poormanlog) and has a LaTeX interface
(\usepackage{poormanlog}).
@@ -22,11 +22,13 @@ Changes
- 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
+ Thus, poormanlog now reduces to only 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.
+- v0.06 (2021/04/21): documentation update (warning?) regarding
+ \PMLogZ{999999999} output being surprisingly 000000000.
Files
-----
@@ -43,15 +45,31 @@ 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
+ nine digits, standing for D = d.dddddddd, 1 <= D < 10
-output: 9 digits xxxxxxxxx standing for X = 0.xxxxxxxxx such that
+output: nine digits xxxxxxxxx standing for X = 0.xxxxxxxxx such that
log10(D) is about X
+ CAUTION: for #1=999999999, the macro outputs 000000000,
+ which are the fractional digits of the correct rounding
+ 1.000000000 of log10(9.99999999)=0.9999999995657...
+
+ As outputting 999999999 to represent log10(0.999999999) is not
+ completely satisfactory either, it is better to work out one's
+ own alternate wrapper of "\the\numexpr\PML@#1." as the latter
+ produces exceptionally 1000000000 with ten digits for
+ #1=999999999, and it is actually as simple to test the
+ exceptional case on this ten digit output than on input.
+
+ Please refer to source code and check how \PMLogZ is built on
+ top of \PML@ output and design own user variant: in place of
+ the gobble in the \PMLogZ one only needs to test if first
+ digit is 2 to identify the special case.
+
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.
+ more than 1 unit in the last (*fixed point*) place,
+ and result differs from rounded mathematical value of
+ log10(D) by at most 1 unit in the last place.
(*attention estimate not rigorously proven*).
@@ -61,10 +79,10 @@ precision: It seems from testing that absolute error is not much
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
+input: #1 must be (f-expands to) exactly nine digits xxxxxxxxx, standing
for X = 0.xxxxxxxxx
-output: 9 digits ddddddddd, such that D = d.dddddddd is about 10^X
+output: nine 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
@@ -77,7 +95,7 @@ precision: It seems from testing that absolute error is less than
LICENSE
-------
-Copyright (C) 2019, Jean-Francois Burnol.
+Copyright (C) 2019-2021, 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