This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: math.h


On Sun, Mar 21, 2004 at 05:07:18PM -0600, pstucklep wrote:
> Since there are no log functions defined in the standard glibc math.h 
> header, 

They are prototyped in math.h.

> how can I compile ansi C files requiring a call to log10 or log2?

log10 is an ISO C89 function, so you just need
#include <math.h>
and it will be prototyped there.  Of course you should not forget to link
with -lm.
log2 is an ISO C99 function, so you need to compile with
-std=c99, -std=gnu99, -D_ISOC99_SOURCE or -D_GNU_SOURCE,
#include <math.h> and link with -lm.
See
info libc "Feature Test Macros"
for details.

	Jakub


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