Page 1 of 1

[General algorithms] custom IEEE-float toString

Posted: Thu 07 Jun, 2007 6:47 pm
by King Harold
I know you can get decimal digits with log10 tricks, but log10 isn't exactly a fast operation..
Is there any way to make a (formatted) string out of an IEEE float/double without using a log10 trick? If so, how does it work?
(and please don't come up with a C function, I know sprintf would do fine but I really need a general algorithm rather than C-only)

Posted: Thu 07 Jun, 2007 8:15 pm
by CoBB
The task is anything but simple, so looking into printf might not be a bad idea after all.

Posted: Thu 07 Jun, 2007 8:31 pm
by King Harold
ok, thanx, that is a whole lot more complicated than I thought it to be..
Luckily it's heavily commented :)
.. now to understand it..