From: Alejandro Colomar <alx@kernel.org>
To: Morten Welinder <mwelinder@gmail.com>
Cc: linux-man@vger.kernel.org, libc-help@sourceware.org,
Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Subject: Re: logb() vs floor(log2()) (was: Man page issues: logb, significand, cbrt, log2, log10, exp10)
Date: Tue, 5 Mar 2024 00:23:55 +0100 [thread overview]
Message-ID: <ZeZYDK7YNG7ptETN@debian> (raw)
In-Reply-To: <ZeYKUOKYS7G90SaV@debian>
[-- Attachment #1: Type: text/plain, Size: 1281 bytes --]
Hi Morten,
On Mon, Mar 04, 2024 at 06:52:10PM +0100, Alejandro Colomar wrote:
> > logb:
> > The formula "floor(log2(x))" should be "floor(log2(fabs(x)))". (Or
> > ...abs(...) if it's meant to be math and not C.)
I've applied thge following patch:
commit 1d83ce827aac984a26430b4f6107182f4b076874 (HEAD -> contrib, alx/contrib)
Author: Alejandro Colomar <alx@kernel.org>
Date: Tue Mar 5 00:20:09 2024 +0100
logb.3: logb(x) is floor(log2(fabs(x)))
log2(3) doesn't accept negative input, but it seems logb(3) does accept
it.
Link: <https://lore.kernel.org/linux-man/ZeYKUOKYS7G90SaV@debian/T/#u>
Reported-by: Morten Welinder <mwelinder@gmail.com>
Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
diff --git a/man3/logb.3 b/man3/logb.3
index 7cbb2470a..7a1ad2f4a 100644
--- a/man3/logb.3
+++ b/man3/logb.3
@@ -58,7 +58,7 @@ .SH DESCRIPTION
is 2,
.BI logb( x )
is equal to
-.BI floor(log2( x ))\fR,
+.BI floor(log2(fabs( x )))\f[R],\f[]
except that it is probably faster.
.P
If
I'll push it tomorrow.
Have a lovely night!
Alex
--
<https://www.alejandro-colomar.es/>
Looking for a remote C programming job at the moment.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-03-04 23:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Alejandro Colomar [this message]
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=ZeZYDK7YNG7ptETN@debian \
--to=alx@kernel.org \
--cc=adhemerval.zanella@linaro.org \
--cc=libc-help@sourceware.org \
--cc=linux-man@vger.kernel.org \
--cc=mwelinder@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.