Mailing List Archive

Support open source code!


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

Re: problems with pow( ) in gcc



>>>>> "David" == David Eduardo Gomez Noguera <davidgn@example.com> writes:

    David> The problem is "pow" is not declared on math.h

No, that may be _a_ problem, but it's not the immediate problem.  gcc
would warn about the undeclared function.  Instead, it's making it all
the way to the link stage, and then not finding the function in the
library.

    David>  (at least it doesnt appeara on my header files either, and
    David> its redhat's glibc.  dont know if redhat screw something,
    David> or if glibc is laggin it.

#include is not forbidden in header files.  See <bits/mathcalls.h> on
glibc 2.2 systems at least.

    David> pow does appear in the info pages, but it doesnt say what
    David> header it requires.

In info, try going up one level.

    Mathematics
    ***********

       This chapter contains information about functions for performing
    mathematical computations, such as trigonometric functions.  Most of
    these functions have prototypes declared in the header file `math.h'.
    The complex-valued functions are defined in `complex.h'.

`man pow' says

    NAME
           exp,  log, log10, pow - exponential, logarithmic and power
           functions

    SYNOPSIS
           #include <math.h>

           double exp(double x);

           double log(double x);

           double log10(double x);

           double pow(double x, double y);

It's arguable that the SYNOPSIS is the only big advantage of the man
format over info.  :-)

-- 
University of Tsukuba                Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences       Tel/fax: +81 (298) 53-5091
_________________  _________________  _________________  _________________
What are those straight lines for?  "XEmacs rules."


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links