Just a friendly reminder, local variables exist on the stack, and "die" on exit of the routine. your routine would be a bit safer of you used a buffer passed in from the caller:
Just to clarify further, the code above uses 'static char outbuf[]' which doesn't die as it's not a local variable, it is statically allocated in memory. However, the next call to the function will overwrite the first call, so something like
printf("%s %s\n", ftoa(...), ftoa(...));
won't work.
It's always a better idea to pass a buffer in, but it's wrong to say that the buffer will 'die'.
exp2 = (0xFF & (x.L >> 23)) - 127; /* JEB fixed for 16-bit char F2xxx */
The cast to unsigned char on most processors would be an AND with 0xFF, but on the T.I. 16-bit DSP, a char is 16-bit and it became an AND with 0xFFFF. This caused errors when converting negative numbers.
Also, users who want to pass in a buffer to eliminate the static char msg[15] should be aware that ftoa() uses the sizeof( msg ) and if this doesn't match, errors will occur.