ilogb()

Compute the exponent of a value as a signed integer.

  #include <math.h>
  
  int ilogb(double x);
  
  int ilogbf(float x);
  
  int double ilogbl(long double x);    
Parameter

x

A floating point value.

Remarks

These functions return the natural exponent of x as a signed int value. If x is zero they return the value FP_ILOGB0. If x is infinite they return the value INT_MAX. If x is a NaN they return the value FP_ILOGBNAN. Otherwise, these functions are equivalent to calling the corresponding logb() functions and casting the returned value to type int. A range error may occur if x is 0. Use fpclassify() to check the validity of the result returned by these functions.

This facility may not be available on configurations of the EWL that run on platforms that do not have floating-point math capabilities.