This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
log2 exist ?
- To: STDC++ <libstdc++ at sources dot redhat dot com>
- Subject: log2 exist ?
- From: Levente Farkas <lfarkas at mindmaker dot hu>
- Date: Wed, 23 Aug 2000 12:31:20 +0200
- Organization: Mindmaker Ltd.
- Reply-To: lfarkas at mindmaker dot hu
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."