|
|
Syntax C/C++ | #include <xmath.h>
double log2( double x );
long double log2l( long double x ); |
Pascal/Delphi | uses xmath;
function log2( x:Extended ): Extended;
function log2d( x:Double ): Double; |
|
Description | The logarithm of the argument to the basis 2 is calculated and the result returned. |
|
Error handling | A DOMAIN error with NAN ("not-a-number") as return value results from x < 0 (including −0). A SING error with -HUGE_VAL as return value results from x=0.
In C/C++, the handling of both errors can be modified via _matherr or _matherrl, resp. |
|
Return value | The binary logarithm of the argument is returned. |
|
|