[PATCH] manual: logb(x) is floor(log2(fabs(x)))
Alejandro Colomar
alx@kernel.org
Mon Mar 4 22:40:59 GMT 2024
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>
---
manual/math.texi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manual/math.texi b/manual/math.texi
index 2f6ee253b9..bf4027c4ee 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
--
2.43.0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20240304/bd9c3c98/attachment.sig>
More information about the Libc-alpha
mailing list