[SOLVED] math.h and pow function

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi freaks,

I have simple program for xmega 128A4U. I want to use function pow(), from math.h.

/simply/
# include

and in main() procedure

double temp;
double i;
...
temp = pow(16, i);
...
- I get error message:
Error 1 Disabling relaxation: it will not work with multiple definitions 1 1 ...

When I write:

temp = pow(16, 2) - compiling is OK.

When I remove line
temp = pow(16, i); - Compiling is OK too.

Any idea ?

(AVR Studio 6.1.2730, Win 8, 64Bit)

Last Edited: Sun. Dec 1, 2013 - 09:56 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Check the type for that second variable. pow() might not like a double there.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It says double,double.

double pow (	double 	__x, 
		double 	__y	 
	)

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

libm.a?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

is there an integer pow() if you don't include libm.a?

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks everybody,

libm.a working....

St.