You should just be able to use #include <math.h> but, what, exactly, "didn't work"?
The MSP file contains sqrt(double) and sqrtf(float) inside nested #ifdefs, so there's no telling which one is right. You may be able to look at the app.c file to see what is actually included. MS Shikhar Sachan wrote: > Thanks for the help...however I was still not able to call the function... > this is what I did... > included the file using > #include " /opt/msp430/msp430/include/math.h" > > made a call to the function > sqrt(3.0); > > but didn't work... > Hope to hear from you soon. And thanking you. > ........................................ > > Also any advice on where I can find components TinyAlloc and interface > Memalloc ....... > > > > > On Tue, Jun 17, 2008 at 6:26 PM, Michael Schippling <[EMAIL PROTECTED]> wrote: >> Rumor has it that malloc() will work, just not very well. >> I haven't tried it. >> >> For math functions, MSP for exapmple has: >> opt/msp430/msp430/include/math.h >> and I'm sure AVR has similar but I don't have it >> loaded on the machine I'm using. Presumably those >> functions are supported by the standard math lib (-lm) >> for the controllers. >> >> MS >> >> Shikhar Sachan wrote: >>> hello users, >>> >>> I wanted to inquire about dynamic memory allocation which I know is >>> not a good idea using the malloc(). A searched a lot but could not get >>> hold of the TinyAlloc component or the memalloc interface that I could >>> use. I guess it is not present in T2 or probably T2 has got a >>> different way for memory allocation. >>> >>> Also I wanted to know how I could use functions like sqrt. I know of >>> codes that could find out the root. However I wanted to know if there >>> are already predefined functions which I could use by including >>> Microcontroller Library Header files. >>> >>> >>> Thanks for the help... >>> >>> Shikhar >>> _______________________________________________ >>> Tinyos-help mailing list >>> [email protected] >>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
