Coldfire / CW6.3/7.0 modf()

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Coldfire / CW6.3/7.0 modf()

1,903 Views
mjbcswitzerland
Specialist V
Hi All

We are trying to use modf() but not having any success with CW.

Test code:
      #include <math.h>
      double  intpart, fractpart, param;

      param = 3.14159265;
      fractpart = modf (param , &intpart);


This results in an error due to math.h not including a prototype for modf().
As reference, the same code works with GNU.

In the MSL C reference manual the function modf() is described with a not that it may not be implemented for all platforms. The Metrowerks link for more infomration goes to the general Freescale web site where there didn't seem to be any more data.

Does any one have any more information on this?

Regards

Mark

www.uTasker.com

Labels (1)
0 Kudos
Reply
1 Reply

902 Views
Nouchi
Senior Contributor II
Hi Mark,

If you want to use floating point functions, you have first, to choose the right library C_4i_CF_MSL.a instead C_4i_CF_SZ_MSL.a (but I'm sure that you know that), and then to customize ansi_prefix.CF.size.h and add macro definition in prefix text field.
see this post.


Emmanuel
http://forums.freescale.com/freescale/board/message?board.id=CWCFCOMM&message.id=1829&query.id=18956...
0 Kudos
Reply