Using floating point numbers in a GCC compiled application

ADL, A&D memory, Flash objects, multi-tasking, file system, DOTA.

Using floating point numbers in a GCC compiled application

Postby FAQ_Poster » Fri Oct 26, 2012 1:00 pm

An application which uses %f format specifier (for printing floating point numbers etc) is compiled using GCC and executed results in module reset.
The reset occurs in the function call which uses %f format specifier. All the other floating point operations (like additions, multiplication, division, subtraction etc) work fine. The problem lies in the usage of %f format specifier.
To overcome this problem (as a workaround), the floating point number should be converted into a string and then used. Whenever, any floating point operation has to be done, this string (containing float values) should be converted back into floating point number, and the operation should then be performed.
After this, it is recommended to convert this float back to the string. It must be noted that the module reset occurs only due to the usage of “%f” format specifier and not due to the floating point operations.
User avatar
Posts: 254
Joined: Thu Oct 25, 2012 7:10 am
Has thanked: 0 time
Have thanks: 5 times

Topic Tags

format specifier, floating, GCC

Return to Operating System FAQ

Who is online

Users browsing this forum: No registered users and 1 guest