Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
We recommend using Visual Studio 2017

logb, logbf, logbl, _logb, _logbf

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at logb, logbf, logbl, _logb, _logbf.

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   
);  

Parameters

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 is 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, logb always takes and returns a double.

InputSEH exceptionMatherr exception
± QNAN,INDNone_DOMAIN
± 0ZERODIVIDE_SING
RoutineRequired header
_logb<float.h>
logb, logbf, logbl, _logbf<math.h>

For more compatibility information, see Compatibility.

All versions of the C run-time libraries.

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

Floating-Point Support
frexp

Show: