??? 09/12/04 12:19 Read: times Msg Score: +2 +2 Good Answer/Helpful |
#77267 - RE: Quesiton about bin to dec Responding to: ???'s previous message |
Wong Chi Fai:
The normal algorithm that you would follow of course is to implement a function set for 5 byte wide (8 bits/byte * 5 = 40 bits) fixed point an arithmetic. By function set I mean a multiply and a divide and maybe also a subtract and an add. Then to convert your 40 bit number to decimal you would repeatedly divide it by successively lower powers of 10 if you want to access the result from the high digit first. You could divide by 10 iteratively and keep the results of the remainder at each step if you wanted to access the low order digits first. There has been discussion on wide integer arithmetic here before. For example look at this thread: http://www.8052.com/forum/read.phtml?id=60392 You could also look into the code libraries that support "arbitrary precision math". Read this posting for example: http://www.8052.com/forum/read.phtml?id=32268 Michael Karas |
Topic | Author | Date |
Quesiton about bin to dec | 01/01/70 00:00 | |
RE: Quesiton about bin to dec | 01/01/70 00:00 | |
RE: Quesiton about bin to dec | 01/01/70 00:00 | |
RE: Quesiton about bin to dec | 01/01/70 00:00 | |
RE: Quesiton about bin to dec![]() | 01/01/70 00:00 |