The previous thread is getting too complex to manage, so I prefer
to start a new one with a clean start.
Attached is the testpad you can use to test your version of itoa() with
thousand separator and sign.
The program is written in standard ANSI C99, so you can compile and test
it on your machines.
When you have a working example to post, insert your itoa() version on the
testpad, post it and the results you get, if you like.
The output is something like:
After we have a few correct versions to test, we canCode:
Testing version : iMalc
------------------------------
Testing on Intel Core Duo 6600 2.4 Ghz
OS = Windows 7 Ultimate 64 bit -- Compiler = Pelles C 6.00.4
The value of num is: -1234567890
The formatted value of num is: -1,234,567,890
Elapsed ClickTime: 296 to perform 10,000,000 cycles
-------------------------------------------------------
handling 0 ---> 0
handling 12 ---> 12
handling 256 ---> 256
handling 1000 --> 1,000
handling 1000000 ---> 1,000,000
handling 1000000000 ---> 1,000,000,000
handling 2147483647 -> 2,147,483,647
handling -2147483648 -> -2,147,483,648
perform the next test with random numbers to have a real
idea of the performance.
Bye for now