This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: math.h
- From: Jakub Jelinek <jakub at redhat dot com>
- To: pstucklep <pstucklep at charter dot net>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Mon, 22 Mar 2004 05:46:04 +0100
- Subject: Re: math.h
- References: <405E2026.7040404@charter.net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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