Jump to content

GOP token limit?


Drazhor

Recommended Posts

2,147,483,647 (2.147b) this is the largest number Java can handle. After you exceed that, a new stack is created, and this goes for all things in runescape, or anything made with Java.

 

This. They are an item, so they share properties all other items share.

Link to comment
Share on other sites

Just to clarify why the number's that. Java in fact can handle larger numbers, but it uses a data storage called an signed long integer. A variable goes back to algebra in mathematics when you use an expression such as a + b = c. Each letter represents an unknown number; similarly programming languages have variables which store data about an unknown value. An signed long integer is basically a variable which takes up 4 bytes (or 32 bits) of memory to store data. Due to the nature of signed variables, one bit of the range is taken up to store the status of negativity. The end byte range for this variable ends up being 31 bits. If you imagine each one of the bits being assigned to true or 1, then the maximum value is 2 ^ 31 which is 2,147,483,648. This is 1 more than the maximum number as "0" itself is counted as a number, so the maximum value which is able to be stored in an signed long integer is (2 ^ (32 - 1) - 1) or 2,147,483,647 as previously mentioned. As to why Jagex decided to use a signed variables instead of an unsigned number bewilders me since there is no need to adopt a negative value for an item count since you can never have a negative item count; however, this data type will be built into the base of all of their modules so it'd be a big change.

 

So you may be asking what if we need to store larger data values? Well this would be possible, but it'd take more RAM. The next data storage after a 32 bit integer is a custom 64 bit integer data storage which has a maximum value of ((2 ^ 64) - 1) or 18,446,744,073,709,551,615. This would mean though that each variable which hold the value for an item count must require double the memory allocation, thus requiring more system resources and quite a lot of changes to a lot of modules built into the game.

 

Probably not necessary to know, but may interest you all the same :D

 

-freddukes

Link to comment
Share on other sites

As to why Jagex decided to use a signed variables instead of an unsigned number bewilders me since there is no need to adopt a negative value for an item count since you can never have a negative item count; however, this data type will be built into the base of all of their modules so it'd be a big change.

 

It's quite simple, really. Java doesn't have unsigned variables. That is, if we leave out things like the char, which can't store such large numbers anyway.

Kidd_Varrow.png

spacespider.png

Link to comment
Share on other sites

Just to clarify why the number's that. Java in fact can handle larger numbers, but it uses a data storage called an signed long integer. A variable goes back to algebra in mathematics when you use an expression such as a + b = c. Each letter represents an unknown number; similarly programming languages have variables which store data about an unknown value. An signed long integer is basically a variable which takes up 4 bytes (or 32 bits) of memory to store data. Due to the nature of signed variables, one bit of the range is taken up to store the status of negativity. The end byte range for this variable ends up being 31 bits. If you imagine each one of the bits being assigned to true or 1, then the maximum value is 2 ^ 31 which is 2,147,483,648. This is 1 more than the maximum number as "0" itself is counted as a number, so the maximum value which is able to be stored in an signed long integer is (2 ^ (32 - 1) - 1) or 2,147,483,647 as previously mentioned. As to why Jagex decided to use a signed variables instead of an unsigned number bewilders me since there is no need to adopt a negative value for an item count since you can never have a negative item count; however, this data type will be built into the base of all of their modules so it'd be a big change.

 

So you may be asking what if we need to store larger data values? Well this would be possible, but it'd take more RAM. The next data storage after a 32 bit integer is a custom 64 bit integer data storage which has a maximum value of ((2 ^ 64) - 1) or 18,446,744,073,709,551,615. This would mean though that each variable which hold the value for an item count must require double the memory allocation, thus requiring more system resources and quite a lot of changes to a lot of modules built into the game.

 

Probably not necessary to know, but may interest you all the same :D

 

-freddukes

 

Wow...I always wondered why this number was 2,147,483,647 and not 2^32. Thanks a lot!

WarBlastoise.png
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.