linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Man page issues: logb, significand, cbrt, log2, log10, exp10
@ 2024-03-01  0:28 Morten Welinder
  2024-03-01  0:53 ` Alejandro Colomar
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Morten Welinder @ 2024-03-01  0:28 UTC (permalink / raw)
  To: alx, linux-man

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.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-03-05  1:18 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-01  0:28 Man page issues: logb, significand, cbrt, log2, log10, exp10 Morten Welinder
2024-03-01  0:53 ` 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

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 NNTP newsgroup(s).