pow function in math header file

Hello,
plz help in this problem.

plz provides me pow(); defination .In borland turbo c 3.0 math.h contains only function Declaration any one tell me where is Defination of function,


Why do you need it?
#include <cmath>
or
#include <math.h> if you are writing in C

http://cplusplus.com/reference/clibrary/cmath/pow/
Your attempt at a request is illegible.
Oh wait, I understand. You see the declaration in the header, but want to know what's in the source...

That's contained in a pre-compiled library that comes with your compiler. It is already in a binary format which is linked automatically by your borland turbo compiler and source code is generally not available.
Stewbond thanx for answer.
please help in make a porgrame.
e.g

#include<conio.h>
#include<iostream.h>

int power(int x,int p)
{
int ans,i;
ans = 1;
for(i = 0; i < p; i++)
ans *= x;

return ans;
}

int main()
{
clrscr();
int b,p,c;
cout<<"Enter a Base & Power";
cin>>b>>p;
c=power(b,p);
cout<<c;
getch();
}

it's works.

But how create pow(); Function for real numbers.


double power(double x,double p)
{
double ans,i;
ans = 1;
for(i = 0; i < p; i++)
ans *= x;

return ans;
}

double main()
{
clrscr();
double b,p=1.0/2.0,c;
cout<<"Enter a Base & Power";
cin>>b;
c=power(b,p);
cout<<c;


Not works it reurn same value.

Here is worng use of for loop.how to use correct
i'm wanted a pow function to any number whose power is 1/2;
e.g (4)^1/2=2,
(81)^1/2=9


plz help me in create my own power(); function

how work with real number as works pow builtin function
This is now more of a theoretical math question rather than a programming question.

Perhaps this link will help:
http://en.wikipedia.org/wiki/Exponentiation_by_squaring.

Integer versions of the function are easy to make, but when you get to decimal exponents, things get a little more difficult.
Topic archived. No new replies allowed.