From: Morten Welinder <mwelinder@gmail.com>
To: alx@kernel.org, linux-man@vger.kernel.org
Subject: Man page issues: logb, significand, cbrt, log2, log10, exp10
Date: Thu, 29 Feb 2024 19:28:10 -0500 [thread overview]
Message-ID: <CANv4PNkVv_0eLgiSP3L_KfC-eZJaVLZ5AP1AGfD0GNrR5M4Hrg@mail.gmail.com> (raw)
I came across some minor issues in some math man pages.
M.
logb:
The formula "floor(log2(x))" should be "floor(log2(fabs(x)))". (Or
...abs(...) if it's meant to be math and not C.)
significand:
The range [1,2) should be [1,FLT_RADIX)
cbrt:
The phrase "every representable real value has a representable real
cube root" is wrong. In fact, a representable cube root is quite
rare. This should be something like "every representable real value
has a real cube root and rounding it to a representable value never
causes overflow or underflow."
log2, log10:
These use, e.g., "base 2 logarithm". Compare that to exp2's "base-2
exponential" (with a hyphen). I am leaning towards the hyphenated
version being correct, but I am not a native English speaker.
exp10:
The man page probably should come with a warning not to use the
function for the time being. The implementation is pretty bad. For
example, results for integer arguments 3, 4, 7, 8, 9, and 17 are
needlessly inaccurate. pow(10,x) is much better, but not perfect.
next reply other threads:[~2024-03-01 0:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-01 0:28 Morten Welinder [this message]
2024-03-01 0:53 ` Man page issues: logb, significand, cbrt, log2, log10, exp10 Alejandro Colomar
2024-03-02 21:17 ` Morten Welinder
2024-03-02 21:54 ` Alejandro Colomar
2024-03-03 2:02 ` Morten Welinder
2024-03-03 2:21 ` Alejandro Colomar
2024-03-03 11:46 ` Vincent Lefevre
2024-03-03 12:21 ` Alejandro Colomar
2024-03-03 22:26 ` Morten Welinder
2024-03-04 12:17 ` Adhemerval Zanella Netto
2024-03-04 17:52 ` logb() vs floor(log2()) (was: Man page issues: logb, significand, cbrt, log2, log10, exp10) Alejandro Colomar
2024-03-04 18:47 ` logb() vs floor(log2()) Adhemerval Zanella Netto
2024-03-04 22:16 ` Alejandro Colomar
2024-03-04 23:23 ` logb() vs floor(log2()) (was: Man page issues: logb, significand, cbrt, log2, log10, exp10) Alejandro Colomar
2024-03-05 0:46 ` Man page issues: logb, significand, cbrt, log2, log10, exp10 Alejandro Colomar
2024-03-05 1:05 ` Alejandro Colomar
2024-03-05 1:18 ` Alejandro Colomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CANv4PNkVv_0eLgiSP3L_KfC-eZJaVLZ5AP1AGfD0GNrR5M4Hrg@mail.gmail.com \
--to=mwelinder@gmail.com \
--cc=alx@kernel.org \
--cc=linux-man@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).