S
S
subdan2014-10-04 19:38:12
hex
subdan, 2014-10-04 19:38:12

Why are two different hexadecimal numbers converted to the same binary?

I have two hexadecimal numbers:
bebb8568a63b1818
bebb8568a63b1800
Each of them I translated to binary:
1011111010111011100001010110100010100110001110110001100000000000
1011111010111011100001010110100010100110001110110001100000000000
As you can see, the two binary numbers are identical.
Why?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mamkaololosha, 2014-10-04
@subdan

Is this the first time you hear that numbers in PC cannot exceed a certain value unless long arithmetic is used?
signed char: -127 to 127 (note, not -128 to 127; this accommodates 1's-complement platforms)
unsigned char: 0 to 255
"plain" char: -127 to 127 or 0 to 255 (depends on default char signedness)
signed short: -32767 to 32767
unsigned short: 0 to 65535
signed int: -32767 to 32767
unsigned int: 0 to 65535
signed long: -2147483647 to 2147483647
unsigned long: 0 to 4294967295
signed long long: -9223372036854775807 to 9223372036854775807
unsigned long long: 0 to 18446744073709551615

S
subdan, 2014-10-04
@subdan

Thanks to all. I realized that this is due to the fact that the binary number is very long and does not fit in an int.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question