From: Alejandro Colomar Date: Tue, 12 Mar 2024 17:25:17 +0000 (+0100) Subject: logb.3: floor(log2(fabs(x))) has rounding errors X-Git-Tag: man-pages-6.7~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4ea5f76215dcf1d8d017eb65ab12919ccf09f3f;p=thirdparty%2Fman-pages.git logb.3: floor(log2(fabs(x))) has rounding errors Link: Reported-by: Vincent Lefevre Suggested-by: Vincent Lefevre Cc: Morten Welinder Cc: Adhemerval Zanella Netto Signed-off-by: Alejandro Colomar --- diff --git a/man3/logb.3 b/man3/logb.3 index 7a1ad2f4a..6d1cb5be8 100644 --- a/man3/logb.3 +++ b/man3/logb.3 @@ -57,9 +57,10 @@ If .B FLT_RADIX is 2, .BI logb( x ) -is equal to +is similar to .BI floor(log2(fabs( x )))\f[R],\f[] -except that it is probably faster. +except that the latter may give an incorrect integer +due to intermediate rounding. .P If .I x