Do address have some special format to separate with common integers?

D

Dik T. Winter

>
> In your opinion, does a 16 bit integer have the same representation as
> a 32-bit integer?

Where did I in my statements restrict the sizes? But, indeed, the
representation is the same (plain binary), but the representable range is
different, just my opinion. Or would you state that the integer 2 is
represented differently in a 16-bit integer from the representation in
a 32-bit integer?
 
K

Keith Thompson

Dik T. Winter said:
Where did I in my statements restrict the sizes? But, indeed, the
representation is the same (plain binary), but the representable range is
different, just my opinion. Or would you state that the integer 2 is
represented differently in a 16-bit integer from the representation in
a 32-bit integer?

Yes, I'd say that those are different representations; one of them has
16 bits, the other has 32 bits.

If you define the term "representation" so loosely that all
collections of bits are the same representation, then I think the term
becomes useless. *All* C objects are collections of bits. Also, I
don't see a definition of the term "representation" in the C standard,
but I think your usage is inconsistent with the standard's usage.
 
P

Phil Carmody

Dik T. Winter said:
Where did

Woh, woh, woh, halt right there! That was a simple yes/no question.
Just answer the question, then make your followup point.
I in my statements restrict the sizes?

You didn't, which is _precisely_ why I felt obliged to inquire if
the omission was an oversight or deliberate.
But, indeed, the
representation is the same (plain binary), but the representable range is
different, just my opinion.

OK, one I can't subscribe to, but you're free to hold it.
Or would you state that the integer 2 is
represented differently in a 16-bit integer from the representation in
a 32-bit integer?

I wouldn't. However, I'd *categorically* say that -1 is represented
differently in a 16-bit integer from the representation in a 32-bit
integer. In fact, out of the 2^32 values that the latter can represent,
I'd only say that 2^15 of them are represented the same way.

Phil
 
P

Phil Carmody

Keith Thompson said:
Yes, I'd say that those are different representations; one of them has
16 bits, the other has 32 bits.

Scrap (part of) what I said before (sorry, long day at work) -
I'm with Keith 100% here.

Phil
 
R

Richard Bos

Dik T. Winter said:
You said: "pointers *may* have different representations from integers", I
said: "pointers have the *same* representation as integers". Pointers are
just a bunch of bits with value 0 or 1 (assuming a binary machine, for other
kinds the discussion is similar). That is the same as a representation of
integers.

By that definition, floating point numbers have the same representation
as integers, as have strings, structures, executable code, and the
contents of /dev/nul. In other words, that definition of
"representation" doesn't _mean_ anything.

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top