Hello,
I did tests with this code:
#include stdlib.h
#include stdio.h
#include math.h
int main()
{
double dummy;
printf("Hello World in C\n\r");
dummy = atof("12.35");
dummy = floor(dummy);
fflush(stdout);
while(1); // Idle
}
>1) I'm not sure what's awry with atof(). Try using a hard-coded floating-point value as
>the input argument rather than a variable character array and see what happens.
atof still return 0.0
>2) Although the documentation says floor() returns an integer, the return value is
>actually of type double. Change your declaration for dummy1 to double instead of int.
floor return 1.0 which is correct, but still generate Access Error exeption.
Implicit cast double to integer doesn't work or passing parameters problem?
For the example, the library in the project are C_4i_CF_MSL.a, C_4i_CF_Runtime and fp_Coldfire.a, I remove from the project *_SZ* library.
My real problem, is that I can't convert a CW6.2 project into CW6.3, because I can't compile project with option require prototypes enabled, I've got errors (function has no prototype) on evry FP functions. I tryed to make a copy of math.h on the source directory without success.
I try to solve the problem with a simple original CW6.3 project stationery.
Thanks,
Emmanuel
Message Edited by BugMan on 2006-08-24 01:52 AM
Message Edited by BugMan on 2006-08-24 01:55 AM