title: How to print floating point value using putchar?
body: <p>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.</p>
  
  <p>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.</p>
  
  <pre><code>void putLong(long x)
  {
      if(x &lt; 0)
      {
          putchar('-');
          x = -x;
      }
      if (x &gt;= 10) 
      {
          putLong(x / 10);
      }
      putchar(x % 10+'0');
  }
  </code></pre>
  
  <p>How could I make a similar function for floats?</p>