From: Alejandro Colomar Date: Sun, 31 Mar 2024 20:38:39 +0000 (+0200) Subject: manual: logb(x) is floor(log2(fabs(x))) X-Git-Tag: glibc-2.40~306 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b7d15bd1f00ae3f941150c9e49e65fbc6595adda;p=thirdparty%2Fglibc.git manual: logb(x) is floor(log2(fabs(x))) log2(3) doesn't accept negative input, but it seems logb(3) does accept it. Link: Reported-by: Morten Welinder Reviewed-by: DJ Delorie Cc: Adhemerval Zanella Netto Cc: Vincent Lefevre Cc: Paul Zimmermann Cc: Andreas Schwab Signed-off-by: Alejandro Colomar --- 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