]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
logb.3: floor(log2(fabs(x))) has rounding errors
authorAlejandro Colomar <alx@kernel.org>
Tue, 12 Mar 2024 17:25:17 +0000 (18:25 +0100)
committerAlejandro Colomar <alx@kernel.org>
Tue, 12 Mar 2024 17:25:19 +0000 (18:25 +0100)
Link: <https://inbox.sourceware.org/libc-alpha/20240305150131.GD3653@qaa.vinc17.org/T/#m3ceecda630012995339bcc5448fee451cf277a8b>
Reported-by: Vincent Lefevre <vincent@vinc17.net>
Suggested-by: Vincent Lefevre <vincent@vinc17.net>
Cc: Morten Welinder <mwelinder@gmail.com>
Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man3/logb.3

index 7a1ad2f4a7eeb66229a9a380bbce6d24eabe3146..6d1cb5be83e8eaccc3f940bced77af7841b1f225 100644 (file)
@@ -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