Re: Number of bits needed to represent numbers
- From: "polymedes" <google@xxxxxxxxxxxxxxxxxx>
- Date: 5 Apr 2007 07:02:30 -0700
On Apr 3, 8:21 am, "Lane Straatman" <inva...@xxxxxxxxxxx> wrote:
"Quadibloc" <jsav...@xxxxxxxxx> wrote in message
news:1175344085.630859.183700@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> polymedes wrote:
Suppose we want to calculate the number of bits needed to represent an
integer number, assuming that this number falls in a certain range.
As an example, take the numbers from 68 to 129. How many bits are
needed for binary representation of these numbers?
Isn't this a rather simple question?
Compared to most questions that count as topical around here, the answer is
probably yes.
There are 26 letters of the alphabet. If you wanted to find out how
many bits were needed to specify a letter of the alphabet, what would
you do?
How many integers are there in the range from 68 to 129? What would
you do to find this out? How many integers are there from 1 to 5? Or
from 2 to 6?
There also has to be some accounting for what numbers are *not* being
represented, for example, is a number's inverse included? Just for kicks and
giggles, I'll give the output for how my machine stores 124 as a float:
/* BEGIN output from bitstr.c */
124.000000 = 01000010111110000000000000000000
/* END output from bitstr.c */
Windows doesn't care much about having twice as much width here as it
needed. Certainly however you need something like log_2(n) bits to
represent minimally a positive integer n.
--
LS
Could you give me a proof that the number of bits needed to represent
a range of n numbers if log_2(n)?
.
- Follow-Ups:
- Re: Number of bits needed to represent numbers
- From: Quadibloc
- Re: Number of bits needed to represent numbers
- From: Dave Dodson
- Re: Number of bits needed to represent numbers
- References:
- Re: Number of bits needed to represent numbers
- From: Lane Straatman
- Re: Number of bits needed to represent numbers
- Prev by Date: Re: eigenvector for a 3-by-3 symmetric real matrix
- Next by Date: Eigenvalues from dot products
- Previous by thread: Re: Number of bits needed to represent numbers
- Next by thread: Re: Number of bits needed to represent numbers
- Index(es):
Relevant Pages
|