Original Post
What is the fastest way to convers numbers to strings? For integers? -Through Logerithems ( slow? ) -Through Mod? I have come up with the following, I don't know if it's any good...
PsuedoCode++:
char* result = new char [ ciel ( log ( abs ( value ))) + ( value >= 0 ) ? 1 : 2 ];
long start = abs ( value );
long diff = 0;
long end = 0;
int position = 0;
if ( value < 0 )
{
result [ 0 ] = '-';
position++;
}
Loop until start = 0
end = start / 10;
diff = start - end * 10;
result [ position++ ] =
start = end;
End Loop
result [ position ] = '\0';
For floats, double? -No idea at all...