|
|
HP-UX Reference > Llog2(3M)HP-UX 11i Version 2: December 2007 Update |
|
NAMElog2(), log2f(), log2l(), log2w(), log2q() — logarithm base two functions DESCRIPTIONlog2() returns the logarithm base two of x. log2f() is a float version of log2(); it takes a float argument and returns a float result. USAGETo use these functions, compile either with the default -Ae option or with the -Aa and -D_HPUX_SOURCE options. To use (for Itanium-based systems) log2w() or log2q(), compile also with the -fpwidetypes option. Make sure your program includes <math.h>, and link in the math library by specifying -lm on the compiler or linker command line. For more information, see the HP-UX Floating-Point Guide. RETURN VALUEIf x is +INFINITY, log2() returns +INFINITY. If x is zero, log2() returns -HUGE_VAL (equal to -INFINITY) and raises the divide-by-zero exception. If x is less than zero, log2() returns NaN and raises the invalid exception. If x is NaN, log2() returns NaN. log2() raises the inexact exception whenever a rounded result does not equal the mathematical result. |
|