Re: gcc and math.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21/03/04, at 18:36 -0600, stucklenp <stucklenp@xxxxxxxxxxx> wrote:

> Kind persons:
> 
> I routinely program using C and compile with gcc.  My problem is that I need
> some math log functions--ln, log10, and log2--and these functions are not
> included in math.h from what I can determine.  Can anyone suggest how I can
> get these functions?

All the functions that you're saying are included. Have a look here for
math.h fucntions:

http://www.opengroup.org/onlinepubs/007908799/xsh/math.h.html

Do a "man function" to find out more about the individual functions. e.g
"man log".

My guess is that you haven't linked your source code to the math
library. (-lm option)

i.e 

gcc -lm myfile.c -o myfile


With kind regards,

Didier.

---
PhD student.

Singapore Synchrotron Light Source (SSLS)
5 Research Link,
Singapore 117603

Email: didierbe at sps dot nus dot edu dot sg

Web: http://ssls.nus.edu.sg





[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux