S
slebetman
Hmm, I posted a reply on this issue but it seems it disappeared. Google
bug?
'Values' don't have number bases. Representations of the value do.
No, you seem to be playing games with language confusing the value of a
representation to the representation itself.
Store in where? In a CPU register, then yes it most probably is binary.
In the graphics frame buffer it is a bunch of pixels related to the
font which when read by a human represents the value. In a file on disk
then it is probably an ASCII string representing the value.
Yes. And it looks something like 42 in decimal and 52 in octal and 2A
in hexadecimal. You used the word 'looks'. That should tell you that
you are only talking about representation, not the value itselt.
If you want to see how that value it looks like in the real world,
under the microscope, instead of binary then it will probably look like
this:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|
of course you can't tell what the value is because all D flip-flop
cells look the same under the microscope. But if you were to attach
tiny LEDs to the outputs you'll see something like:
off, off, off .. on, off, on, off, on, off
But then again, that's merely a representation issue of the actual
voltages:
0V, 0V .. 5V, 0V, 5V, 0V, 5V, 0V
which, again, is merely a representation of the number 42
Well, we are talking about C here. And C doesn't define it as a binary
operation. C defines it as an arithmetic operation equivalent to
modulo2(x/2).
Someone confused the word 'value' with 'representation' earlier in the
thread and is now arguing with Richard about it.
Go back to what you learned in high school. A number 'base' defines a
'number system' used to represent a 'number'. Numbers (hence values) by
themselves don't have bases. But we need a way to write down
(represent) numbers in order to talk about them. Hence we need a number
system to describe numbers. A 'base' simply defines how much larger a
digit to the 'left' is compared to the current digit in that number.
Altering the base of a number system does not alter the 'value' of that
number itself. It merely alters the number system: how the number is
represented (otherwise I will find myself with fewer fingers if I
suddenly decide to count them in hex and more fingers if I decide to
count them in octal).
bug?
Because 'stored' values do have number bases.
'Values' don't have number bases. Representations of the value do.
You seem to be playing games with language.
No, you seem to be playing games with language confusing the value of a
representation to the representation itself.
Values in C stored in 'int x' have binary representation in memory.
Store in where? In a CPU register, then yes it most probably is binary.
In the graphics frame buffer it is a bunch of pixels related to the
font which when read by a human represents the value. In a file on disk
then it is probably an ASCII string representing the value.
Whether 42, 052 or 0x2A the int in memory looks something like 0..00101010
in binary.
Yes. And it looks something like 42 in decimal and 52 in octal and 2A
in hexadecimal. You used the word 'looks'. That should tell you that
you are only talking about representation, not the value itselt.
If you want to see how that value it looks like in the real world,
under the microscope, instead of binary then it will probably look like
this:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|
of course you can't tell what the value is because all D flip-flop
cells look the same under the microscope. But if you were to attach
tiny LEDs to the outputs you'll see something like:
off, off, off .. on, off, on, off, on, off
But then again, that's merely a representation issue of the actual
voltages:
0V, 0V .. 5V, 0V, 5V, 0V, 5V, 0V
which, again, is merely a representation of the number 42
The value of 'x >> 1' will look like 0..00010101 which seems to be a binary
operation to me.
Well, we are talking about C here. And C doesn't define it as a binary
operation. C defines it as an arithmetic operation equivalent to
modulo2(x/2).
What am I missing?
Someone confused the word 'value' with 'representation' earlier in the
thread and is now arguing with Richard about it.
Go back to what you learned in high school. A number 'base' defines a
'number system' used to represent a 'number'. Numbers (hence values) by
themselves don't have bases. But we need a way to write down
(represent) numbers in order to talk about them. Hence we need a number
system to describe numbers. A 'base' simply defines how much larger a
digit to the 'left' is compared to the current digit in that number.
Altering the base of a number system does not alter the 'value' of that
number itself. It merely alters the number system: how the number is
represented (otherwise I will find myself with fewer fingers if I
suddenly decide to count them in hex and more fingers if I decide to
count them in octal).