I am working on an embedded application and need to print floating point values. Due to space and other limitations I can only use putchar() for output.
I am trying to create a function that takes a float as parameter and prints it using putchar(). I have a similar function that works for integer values.
void putLong(long x)
{
if(x < 0)
{
putchar('-');
x = -x;
}
if (x >= 10)
{
putLong(x / 10);
}
putchar(x % 10+'0');
}
How could I make a similar function for floats?