[ create a new paste ] login | about

Link: http://codepad.org/7QLze0b2    [ raw code | output | fork ]

C, pasted on Jul 2:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include <math.h>

double mypow(double x, double y) {
  if (y > 0)
    return exp(x * log(y));
  else
    return 0.0;
}

int main() {
  double x, y;
  printf("x=");
  scanf("%lf", &x);
  printf("y=");
  scanf("%lf", &y);
  printf("mypow:%f, pow:%f\n", mypow(x, y), pow(x, y));
  return 0;
}
/* end */


Output:
1
2
3
4
5
In function `mypow':
undefined reference to `log'
undefined reference to `exp'
In function `main':
undefined reference to `pow'


Create a new paste based on this one


Comments: