1 .\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>.
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .\" Inspired by a page by Walter Harms created 2002-08-10
9 .TH LOGB 3 (date) "Linux man-pages (unreleased)"
11 logb, logbf, logbl \- get exponent of a floating-point value
14 .RI ( libm ", " \-lm )
19 .BI "double logb(double " x );
20 .BI "float logbf(float " x );
21 .BI "long double logbl(long double " x );
25 Feature Test Macro Requirements for glibc (see
26 .BR feature_test_macros (7)):
31 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
32 || _XOPEN_SOURCE >= 500
33 .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
34 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
35 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
41 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
42 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
43 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
46 These functions extract the exponent from the
47 internal floating-point representation of
49 and return it as a floating-point value.
54 indicates the radix used for the system's floating-point representation.
60 .BI floor(log2( x ))\fR,
61 except that it is probably faster.
69 would have if it were normalized.
71 On success, these functions return the exponent of
81 is zero, then a pole error occurs, and the functions return
90 is negative infinity or positive infinity, then
91 positive infinity is returned.
95 for information on how to determine whether an error has occurred
96 when calling these functions.
98 The following errors can occur:
100 Pole error: \fIx\fP is 0
104 A divide-by-zero floating-point exception
108 These functions do not set
110 .\" FIXME . Is it intentional that these functions do not set errno?
111 .\" log(), log2(), log10() do set errno
112 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6793
117 .\" function occurs in 4.3BSD.
118 .\" see IEEE.3 in the 4.3BSD manual
120 For an explanation of the terms used in this section, see
128 Interface Attribute Value
133 T} Thread safety MT-Safe
139 C99, POSIX.1-2001, POSIX.1-2008.