i want to do mathematical operations - power of 5/3 of a variable

i am using arduino ATmega328 for my mini project is that possible.

Otherwise please suggest the arduino pleas.

Dependent on the range of values you expect to encounter, tricky mathematical functions are usually best carried out by using a look up table.

Simple as

#include <math.h>
...

 double v = 5.5;
 double u = pow(v, 5.0/3.0);
...

Thanks

While that might work, be aware that double on an AVR is actually the same as a float.... and as such depending on the number of digits precision you are after, the result may or may not be accurate.

Try specific tests on your arduino, based on the input range of your variable, then do comparisons on your PC using calculator.........then decide if the accuracy is acceptable.

Regards,

Graham

ghlawrence2000:
While that might work, be aware that double on an AVR is actually the same as a float.... and as such depending on the number of digits precision you are after, the result may or may not be accurate.

Try specific tests on your arduino, based on the input range of your variable, then do comparisons on your PC using calculator.........then decide if the accuracy is acceptable.

Regards,

Graham

This is why I suggested the lookup table instead. This way you can have the calculations done before hand on a machine with much better arithmetic abilities.

KenF:
This is why I suggested the lookup table instead. This way you can have the calculations done before hand on a machine with much better arithmetic abilities.

Yes, I knew what you meant, I just thought I would spell it out for him :wink:

Graham