title | description | ms.date | api_name | api_location | api_type | topic_type | f1_keywords | helpviewer_keywords | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
logb, logbf, logbl, _logb, _logbf |
API reference for logb, logbf, logbl, _logb, and _logbf; which extract the exponent value of a floating-point argument. |
1/15/2021 |
|
|
|
|
|
|
Extracts the exponent value of a floating-point argument.
double logb(
double x
);
float logb(
float x
); // C++ only
long double logb(
long double x
); // C++ only
float logbf(
float x
);
long double logbl(
long double x
);
double _logb(
double x
);
float _logbf(
float x
);
#define logb(X) // Requires C11 or higher
x
A floating-point value.
logb
returns the unbiased exponent value of x
as a signed integer represented as a floating-point value.
The logb
functions extract the exponential value of the floating-point argument x
, as though x
were represented with infinite range. If the argument x
is denormalized, it's treated as if it were normalized.
Because C++ allows overloading, you can call overloads of logb
that take and return float
or long double
values. In a C program, unless you're using the <tgmath.h>
macro to call this function, logb
always takes and returns a double
.
If you use the logb
macro from <tgmath.h>
, the type of the argument determines which version of the function is selected. See Type-generic math for details.
Input | SEH exception | _matherr exception |
---|---|---|
± QNaN, IND | None | _DOMAIN |
± 0 | ZERODIVIDE |
_SING |
By default, this function's global state is scoped to the application. To change this behavior, see Global state in the CRT.
Routine | Required header |
---|---|
_logb |
<float.h> |
logb , logbf , logbl , _logbf |
<math.h> |
logb macro |
<tgmath.h> |
For more compatibility information, see Compatibility.
All versions of the C run-time libraries.