Re: Binary number digits <- > Decimal number digits
- From: "mensanator@xxxxxxxxxxx" <mensanator@xxxxxxx>
- Date: Sun, 9 Dec 2007 20:55:34 -0800 (PST)
On Dec 9, 1:52 pm, hagman <goo...@xxxxxxxxxxxxx> wrote:
On 9 Dez., 18:28, "mensana...@xxxxxxxxxxx" <mensana...@xxxxxxx> wrote:
On Dec 9, 10:50�am, Jeremy Boden <jer...@xxxxxxxxxxxxxxx> wrote:
On Sun, 09 Dec 2007 16:58:11 +0100, Helmut Richter wrote:
On Sun, 9 Dec 2007, fc wrote:
For example, what calculus was made to arrive that a decimal number of
617 digits must have 2048 digits in binary? (Obviously, without make
the conversion of the decimal number 999999...99999 [617 9 numbers] to
binary) And: how to generalize for any decimal number of any length?
The number of digits of x in some base b is, not regarding rounding to
integers, the logarithm of x with respect to base b, which is �log x /
log b (log to arbitrary base).
So the number of decimal digits of x is �log 2 / log 10 = 0.30103 .
For a rough calculation, 2^10 = 1024,
So 10 bits is approximately 3 digits.
How come you didn't round up?
3.0102999566398119521373889472449 rounds to 4
giving you the correct answer: 10 bits makes
4 decimal digits.
Yep, and incidently 1024 indeed *has* 4 decimal digits.
But it also need 11 bits. Anyway, the biggest 10-bit number is 1023
and
is a 4-digit numerb, too.
Now, how many decimal digits will you get with 10,000 instead of 10
bits?
3010.2999566398119521373889472449
Does rounding play a big role here?
Sure, it rounds to 3011 (when done properly).
3011m = 2**10000 - 1
gmpy.numdigits(m,10)
What is the bit-per-digit ratio for those big numbers?
Same as it is for small numbers.
hagman
.
- References:
- Binary number digits <- > Decimal number digits
- From: fc
- Re: Binary number digits <- > Decimal number digits
- From: Helmut Richter
- Re: Binary number digits <- > Decimal number digits
- From: Jeremy Boden
- Re: Binary number digits <- > Decimal number digits
- From: mensanator@xxxxxxxxxxx
- Re: Binary number digits <- > Decimal number digits
- From: hagman
- Binary number digits <- > Decimal number digits
- Prev by Date: Easy probability question (Bayes theorem)
- Next by Date: topological groups and covering groups
- Previous by thread: Re: Binary number digits <- > Decimal number digits
- Next by thread: Re: Binary number digits <- > Decimal number digits
- Index(es):
Relevant Pages
|