Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C99 |
both | z/OS® V1R5 |
#define _ISOC99_SOURCE
#include <math.h>
double log2(double x);
float log2f(float x);
long double log2l(long double x);
#define _TR1_C99
#include <math.h>
float log2(float x);
long double log2(long double x);
Function | Hex | IEEE |
---|---|---|
log2 | X | X |
log2f | X | X |
log2l | X | X |
The log2 functions return log2 x.
A domain error occurs if x is less than zero. A range error may occur if x is zero.
Special behavior for IEEE: If x is equal to 0, a pole error will occur and errno remains unchanged.
When environment variable _EDC_SUSV3 is set to 2, and if x is equal to 0, the function returns -HUGE_VAL and sets errno to ERANGE.