Has anyone got recent code for dword to ascii, signed and unsigned ?

Started by hutch--, August 17, 2010, 04:40:43 PM

Previous topic - Next topic

dedndave

maybe these tables will help
as you can see, the longest strings occur more often
although, it depends on the application to some degree
if you only evaluate longer integers, a routine that is fast on short ones gets slighted
frequency of occurance
32 bit integers converted to decimal strings

unsigned (number of characters = number of digits)

1 digit  10
2 digits 90
3 digits 900
4 digits 9000
5 digits 90000
6 digits 900000
7 digits 9000000
8 digits 90000000
9 digits 900000000
10 digits 3294967296

signed positive (number of characters = number of digits)

1 digit  10
2 digits 90
3 digits 900
4 digits 9000
5 digits 90000
6 digits 900000
7 digits 9000000
8 digits 90000000
9 digits 900000000
10 digits 1147483648

signed negative (number of characters = number of digits plus 1)

1 digit  9
2 digits 90
3 digits 900
4 digits 9000
5 digits 90000
6 digits 900000
7 digits 9000000
8 digits 90000000
9 digits 900000000
10 digits 1147483649

KeepingRealBusy

Dave,

Quote
Posted by: dedndave
   ...
but, seriously, it seems like everything boils down to a collection of huge tables
and the fastest routine is the one that addresses the table faster - lol

That is what I jokingly was referring to at the beginning of this thread:
http://www.masm32.com/board/index.php?topic=14642.msg118665#msg118665

Dave.