The ** ilogb( )** functions return the exponent of their floating-point argument as a signed integer. If the argument is not normalized,

**returns the exponent of its normalized value.**

*ilogb( )*Here’s simple program that uses **ilogb()**

12345678 #include <math.h>int main(int argc, char*argv[]){double x = 1234.5678;int retval = ilogb(x);return 0;}

Now, if You use this function and get the following gcc linker error:

undefined reference to `ilogb’

That probably means that You did not tell gcc to link proper library (which contains ilogb function).

You can do this by using **-lm** switches. The **-l** means link a library. The **m** means the math library. You need to link the math library. This is the standard library that has common math functions like sqrt, sin, cos, log, etc. Linking makes these functions available to the main program.

Now You should be able to properly and successfully compile and link Your program.

$ gcc ilogb.c -lm