C examples for math.h:logb
function
<cmath> <ctgmath> <math.h>
Returns the logarithm of |x|, using FLT_RADIX as base for the logarithm.
On most platforms, FLT_RADIX is 2.
long double logbl (long double x); long double logb (long double x); double logb (double x); float logbf (float x); float logb (float x); double logb (T x);
Parameter | Description |
---|---|
x | Value whose logarithm is calculated. |
The base-FLT_RADIX logarithm of x.
#include <stdio.h> #include <math.h> int main ()//ww w .j av a 2s.c om { double param = 1024.0; double result = logb (param); printf ("logb (%f) = %f.\n", param, result ); return 0; }