- May 11, 2008
- 21,965
- 1,354
- 126
Hi, i am fiddling around with my gcc compiler for my arm7tdmi.
I am using sprintf from gcc.
I tried using float for single precision and double but both give the same 0 value.
I just do not get what i am doing wrong.
Have i forgotten to add a library to the linker or something or some header file gcc needs ?
The sprintf seems to work, i tried decimal values and it works fine.
But when i try to print floating point values it always gives -0.0.
The bin files does get about 27kB larger , a lot of functions are added.
I am using sprintf from gcc.
Code:
fl1 = 3.14567;
test = sprintf(sparray, "float value %8.5f\r\n", fl1);
I tried using float for single precision and double but both give the same 0 value.
I just do not get what i am doing wrong.
Have i forgotten to add a library to the linker or something or some header file gcc needs ?
The sprintf seems to work, i tried decimal values and it works fine.
But when i try to print floating point values it always gives -0.0.
The bin files does get about 27kB larger , a lot of functions are added.