Given an (unsigned) integer, what is the generally fastest way to convert it into a string that contains its decimal representation?
The naïve way of doing that
The MS version of printf does it the "naïve" way (after setting up a bunch of variables based on the optional flags):
while (precision-- > 0 || number != 0) {
digit = (int)(number % radix) + '0';
number /= radix; /* reduce number */
if (digit > '9') {
/* a hex digit, make it a letter */
digit += hexadd;
}
*text.sz-- = (char)digit; /* store the digit */
}