Page 1 of 1

library math.h

Posted: Wed Nov 09, 2016 10:15 am
by thomas110594
Hi everyone,

I'm using a TD1204 and I want to use the math.h library. It seems that eclipse compile and generate the bin file, but nothing happened on the module.
How can I use the pow and sqrt function? Do I have to create approximative function?

Thank you

Re: library math.h

Posted: Mon Nov 21, 2016 3:47 pm
by gideonBreo
Did you find any solution, I was thinking using the "arm-math.h" lib, but I still have some issues even with ARM_MATH_CM3 defined.

Regards

Re: library math.h

Posted: Tue Nov 22, 2016 8:31 am
by gideonBreo
did you enable the FPU ?

Re: library math.h

Posted: Mon Nov 28, 2016 2:19 pm
by mstempin
There is no FPU onboard.

I personally don't use the math functions at all in such a low-power embedded MCU, as they tend to increase considerably the firmware size, as software floating point functions are linked in.

If you are trying to use sqrt() for computing a vector norm, I suggest to try the fast inverse square root trick:
https://en.wikipedia.org/wiki/Fast_inverse_square_root