As a personal project, I have been writing a compiler for my own C like language to target a CPU emulator of my own design.
As a part of this, I want to implement a standard floating point library (typical IEEE single precision), but I've been struggling to think of a way to print out floats in an easy to read way (as in 1.2345 rather than the raw data integer), the best I could think of is generating values for log102 and doing some odd multiplications to get the number in a suitable form for printing.
Is there an algorithm for converting a float to an easily printable form, or for printing a float which can be implemented without using printf("%f",float_value);
or type castings in a C like language?