_logb, _logbl
Go Up to float.h Index
Header File
float.h
Prototype
double _logb(double d);
long double _logbl(long double ld);
Description
Extracts the exponential value of a double-precision floating-point argument. If the argument is denormalized, it is treated as if it were normalized.
_logbl is the long double version; it takes a long double argument and returns a long double result.
Return Value
Returns the unbiased exponent of the value passed in.
POSIX | ANSI C | ANSI C++ | Win32 | Win64 | OS X | |
---|---|---|---|---|---|---|
_logb | + | |||||
_logbl | + |
Example
#include <math.h>
#include <stdio.h>
int main(void) {
double result;
double x = 8.6872;
result = _logb(x);
printf("The natural log of %lf is %lf\n", x, result);
return 0;
}