From a4ea5f76215dcf1d8d017eb65ab12919ccf09f3f Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Tue, 12 Mar 2024 18:25:17 +0100 Subject: 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 --- man3/logb.3 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- cgit v1.2.3