# 2,147,483,647?



## Wolfenpilot687 (Nov 17, 2008)

Is the number 2,147,483,647 really the biggest number in binary?


----------



## net-cat (Nov 17, 2008)

No. It's the largest 32-bit signed integer.

4,294,967,295 <- 32-bit unsigned.

9,223,372,036,854,775,807 <- 64-bit signed.

18,446,744,073,709,551,615 <- 64-bit unsigned.

To put it in perspective, that's a bit like asking if 999,999,999,999 is the largest decimal number.


----------



## Wolfenpilot687 (Nov 17, 2008)

Oh, ok! But still, it's a very trivial number...


----------



## Eevee (Nov 17, 2008)

What do you mean, "trivial"?


----------



## Wolfenpilot687 (Nov 17, 2008)

Gran Turismo 3. (?)


----------



## Aden (Nov 18, 2008)

Well, it's not like it has to be a significant or even number. It's just the end of what the system can describe.


----------



## Eevee (Nov 18, 2008)

It's 2^31 - 1, or 2^(2^5 - 1) - 1.  Seems significant/interesting enough to me, but I have a hardon for number theory.


----------



## feilen (Nov 18, 2008)

It would be then 0x11111111111111111111111111111111, it's not trivial just the maximum it can achieve with that many digits.


----------



## net-cat (Nov 18, 2008)

Actually, "0x" generally represents hexadecimal. 0x7FFFFFFF

I'd buy "11111111111111111111111111111111[sub]2[/sub]", though.

32-bit is the length limit of a register in one instruction in 32-bit systems. You can _do_ larger numbers, it just takes a few more steps...


```
mov eax, [first_operand]
mov ebx, [first_operand + 4]
add eax, [second_operand]
adc ebx, [second_operand + 4]
```
Result being ebx:eax

... or something like that. My x86 is a bit rusty.


----------



## Wolfenpilot687 (Nov 30, 2008)

Geez, so THERE's a difference between binary and hexadecimal. I knew it, but...not the real difference.


----------



## dietrc70 (Nov 30, 2008)

To put it another way, binary is base 2 (two possible values for each digit), decimal is base 10 (10 possible values for each digit), and hexadecimal is base 16.

Binary: 0,1
Decimal: 0,1,2,3,4,5,6,7,8,9
Hex: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

F (in hex) equals 15 (in decimal) equals 1111 (in binary).

Hex is very popular for programmers because you can represent all possible values for a four digit binary number with a single hexadecimal digit.


----------



## Wolfenpilot687 (Nov 30, 2008)

dietrc70 said:


> To put it another way, binary is base 2 (two possible values for each digit), decimal is base 10 (10 possible values for each digit), and hexadecimal is base 16.
> 
> Binary: 0,1
> Decimal: 0,1,2,3,4,5,6,7,8,9
> ...


Nice. ^_^


----------



## Stratelier (Nov 30, 2008)

Wolfenpilot687 said:


> Gran Turismo 3. (?)



Is it from a game?  Suddenly it all makes sense.  4-bit signed integers are about the most common datatype in computer/game programming, rarely do you actually need numbers larger than that.


----------



## Lobar (Nov 30, 2008)

When I saw the thread title I recognized it as 2^31 - 1 immediately, then felt like a huge dork.

thanks wolfenpilot687 :-x


----------



## LizardKing (Nov 30, 2008)

Needs more 1.79e308


----------



## Pi (Nov 30, 2008)

Stratadrake said:


> 4-bit signed integers



I think you mean 4 byte, 32-bit.


----------

