This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

log2 exist ?


hi,
may be it's C question rather than a c++, but...
is log2 part of the standard C or c++ library ? I see in that
/usr/include/g++-v3/bits/std_cstdlib.h:#define __USE_ISOC9X 1
/usr/include/features.h:# define __USE_ISOC9X   1
and I found in /usr/include/bits/mathcalls.h:
-----------------
#ifdef __USE_ISOC9X
/* Compute base-2 exponential of X.  */
__MATHCALL (exp2,, (_Mdouble_ __x));

/* Compute base-2 logarithm of X.  */
__MATHCALL (log2,, (_Mdouble_ __x));
#endif
-----------------
and in /usr/include/bits/mathinline.h:
-----------------
#ifdef __USE_ISOC9X
__inline_mathop_decl (log2, "fld1; fxch; fyl2x",
"0" (__x) : "st(1)")
-----------------
but the following code is not compiled anyway (with/without std and 
cmath<->math.h...):
-----------------
#include <math.h>
#include <stdlib.h>

int main()
{
  int i = std::log2(4);
  return 0;
}
-----------------
any tipp ? thanks.

 -- Levente
 "The only thing worse than not knowing the truth is
  ruining the bliss of ignorance."

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]