Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE
Tool/software: Code Composer Studio
Hello TI World:
Since CCS does not include an ftoa() function, and the sprint() function requires an excessive amount of stack space, one must create their own ftoa() function.
While testing the ftoa() function, it has been observed that the atof() function seems to not be as accurate as it should be.
For example, the result for atof(“-9196.013671875”) is -9196.01172 as shown in the image of the debug results below:
I would have expected that the first 7 digits (i.e. 9196.013) would be the same.
A difference of nearly 0.002 seems excessive.
Is that much of a difference reasonable for a 32 bit floating point number?
Thank you,
Tim Ball
TDB Consulting
P.S. As you may know, the sprint() function using the “%g” format specifier works but “%f” crashes the system, even with a stack size of 0x400.




