public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] manual: logb(x) is floor(log2(fabs(x)))
Date: Wed,  3 Apr 2024 12:29:27 +0000 (GMT)	[thread overview]
Message-ID: <20240403122927.2908E3847718@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b7d15bd1f00ae3f941150c9e49e65fbc6595adda

commit b7d15bd1f00ae3f941150c9e49e65fbc6595adda
Author: Alejandro Colomar <alx@kernel.org>
Date:   Sun Mar 31 22:38:39 2024 +0200

    manual: 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>
    Reviewed-by: DJ Delorie <dj@redhat.com>
    Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
    Cc: Vincent Lefevre <vincent@vinc17.net>
    Cc: Paul Zimmermann <Paul.Zimmermann@inria.fr>
    Cc: Andreas Schwab <schwab@linux-m68k.org>
    Signed-off-by: Alejandro Colomar <alx@kernel.org>

Diff:
---
 manual/math.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/manual/math.texi b/manual/math.texi
index 2f6ee253b9..c54eaebb65 100644
--- a/manual/math.texi
+++ b/manual/math.texi
@@ -561,7 +561,7 @@ These functions return the base-2 logarithm of @var{x}.
 @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
 These functions extract the exponent of @var{x} and return it as a
 floating-point value.  If @code{FLT_RADIX} is two, @code{logb} is equal
-to @code{floor (log2 (x))}, except it's probably faster.
+to @code{floor (log2 (fabs (x)))}, except it's probably faster.
 
 If @var{x} is de-normalized, @code{logb} returns the exponent @var{x}
 would have if it were normalized.  If @var{x} is infinity (positive or

                 reply	other threads:[~2024-04-03 12:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240403122927.2908E3847718@sourceware.org \
    --to=azanella@sourceware.org \
    --cc=glibc-cvs@sourceware.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).