Page 2 of 2

Re: How to convert binary to BCD ?

Posted: Sat Jan 26, 2013 3:19 am
by Saman
Why 26 bit ? Cant represent more than 26 bit numbers ?
Is Reason for limit ,for 32 bit output? :idea:
The maximum number which can show in 26-bits is (226 - 1) = 67108863
There are 8 digits which needs 8 nibbles of 4 bytes.

Now consider (227 - 1)... it is 134217728 and it has 9 digits.
It needs 9 nibbles. That is 4-bytes and another nibble which can't be accommodated in a 32-bit integer type.

So for your question, answer is yes.

If you select the return type to be a 64-bit type such as long long or __int64, then you can represent 16-digits with those.

Re: How to convert binary to BCD ?

Posted: Sat Jan 26, 2013 8:51 am
by Nandika
Thank Saman

Completely clear all.. :)

Thank All friends...
:yahoo:

Re: How to convert binary to BCD ?

Posted: Fri Sep 27, 2013 3:07 pm
by penlock
Hi everyone.. kak kak :clap: :clap:

Re: How to convert binary to BCD ?

Posted: Wed Mar 12, 2014 3:35 pm
by Drew2
Thanks for the post!