mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-14 13:00:20 +00:00
manual: logb(x) is floor(log2(fabs(x)))
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> Reviewed-by: DJ Delorie <dj@redhat.com> Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> Cc: Vincent Lefevre <vincent@vinc17.net> Cc: Paul Zimmermann <Paul.Zimmermann@inria.fr> Cc: Andreas Schwab <schwab@linux-m68k.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
parent
4dcd674b66
commit
b7d15bd1f0
@ -561,7 +561,7 @@ These functions return the base-2 logarithm of @var{x}.
|
|||||||
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
|
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
|
||||||
These functions extract the exponent of @var{x} and return it as a
|
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
|
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}
|
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
|
would have if it were normalized. If @var{x} is infinity (positive or
|
||||||
|
Loading…
Reference in New Issue
Block a user