Forums

math.h not working in Crossstudio

Started by "r.jensenm" November 26, 2008
Hi all,

I have tried to use the math function powf but my float
var "scale_level" stays zero.

I have tried several other math function a get strange results aswell

any idea ?

part of my code********************
float scale_level, level_inp;
level_inp = 100;
scale_level = powf(level_inp, 1,20242);
***********************************

Regards M

An Engineer's Guide to the LPC2100 Series

r.jensenm schrieb:

> I have tried to use the math function powf but my float
> var "scale_level" stays zero.
>
> I have tried several other math function a get strange results aswell
>
> any idea ?

You did check your stack-usage, didn't you ?

Customer of us reported that the stack must be aligned to 8 bytes.

--
42Bastian

Note: SPAM-only account, direct mail to bs42@...

> scale_level = powf(level_inp, 1,20242);

Doesn't powf() take two arguments, not three ?

Hi,

> Hi all,
>
> I have tried to use the math function powf but my float
> var "scale_level" stays zero.
>
> I have tried several other math function a get strange results aswell
>
> any idea ?
>
> part of my code********************
> float scale_level, level_inp;
> level_inp = 100;
> scale_level = powf(level_inp, 1,20242);
> ***********************************

All these functions are tested and known to work. Make sure you #include
and you'll need 1.20242 (maybe with a suffix F if you're a pedant).

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

Thanks 42Bastian,

How can I monitor the stack usage in CrossStudio?

--- In l..., 42Bastian wrote:
>
> r.jensenm schrieb:
>
> > I have tried to use the math function powf but my float
> > var "scale_level" stays zero.
> >
> > I have tried several other math function a get strange results
aswell
> >
> > any idea ?
>
> You did check your stack-usage, didn't you ?
>
> Customer of us reported that the stack must be aligned to 8 bytes.
>
> --
> 42Bastian
>
> Note: SPAM-only account, direct mail to bs42@
>