zeldan Posted October 27, 2006 Share Posted October 27, 2006 answer these questions for me and ill love ya fer life :) 1. What is the maximum amount of money any rs player can have (must be exact) 2. Why is that number the maximum amount? 3. what happens if you have that amount and try to add more money? i needa know these answers plz :) Link to comment Share on other sites More sharing options...
icecube Posted October 27, 2006 Share Posted October 27, 2006 1) 2.1B 2) Max number in binary coding or something to that extent. 3) I don't know. Either starts another stack (doubtfully) or your money goes to 0. Link to comment Share on other sites More sharing options...
vlad_the_old Posted October 27, 2006 Share Posted October 27, 2006 1) Unknown at present - there have been players with billions in their account 1,000,000,000 - i am told it shows in the account as 1,000 mil (or m - i forget) 2) As above 3) The counter flicks over - if the field on the database they store it in is signed it shows as 0 on your screen, if unsigned you get a very large negative number :twisted: Now answer one Why do you need to know? Thanks to 4be2jue for the sigs. There are 10 types of people in the world - those that understand binary and those that don't! Link to comment Share on other sites More sharing options...
zeldan Posted October 27, 2006 Author Share Posted October 27, 2006 i win a free sig if i get the right answer, and the exact gp number IS known Link to comment Share on other sites More sharing options...
vlad_the_old Posted October 27, 2006 Share Posted October 27, 2006 Well in that case it may be the maximum you can store in a register / double word - thats 16 bytes - would be FFFF FFFF FFFF FFFF in hexidicimal so that would be 18,446,744,073,709,551,605. If they were just using a single word (4 bytres) the maximum would be 4,294,967,295. Obviously these are the miximum values that can be held in a field of that length - if the field was signed the maximum would be roughly halved. *Edit* It was late when I wrote this and just spotted an error. A word is 2 bytes long and a double word / register is 4 bytes. the 16 byte field is different and is to do more with mainframes. Thanks to 4be2jue for the sigs. There are 10 types of people in the world - those that understand binary and those that don't! Link to comment Share on other sites More sharing options...
zeldan Posted October 27, 2006 Author Share Posted October 27, 2006 um, ? Link to comment Share on other sites More sharing options...
icecube Posted October 27, 2006 Share Posted October 27, 2006 um, ? I still say 2.1B :D Roughly half of 4,294,967,295, which is 11111111111111111111111111111111 in binary. Link to comment Share on other sites More sharing options...
zeldan Posted October 27, 2006 Author Share Posted October 27, 2006 it is ABOUT 2.1B, but i need an exact =\ sum1 told me one that i thik is right, but i still dont know the other 2 answers Link to comment Share on other sites More sharing options...
icecube Posted October 27, 2006 Share Posted October 27, 2006 If they can't explain why it's the max, I personally wouldn't trust their answer, though it may be right (small chance). Link to comment Share on other sites More sharing options...
vlad_the_old Posted October 27, 2006 Share Posted October 27, 2006 um, ? I still say 2.1B :D Roughly half of 4,294,967,295, which is 11111111111111111111111111111111 in binary. :lol: 2,147 mil (2,147,483,647) 7F FF FF FF in hex And yes - it is that in binary :thumbsup: The next number 80 00 00 00 is minus 1 but any decent coder would have checked and stopped that happening. Thanks to 4be2jue for the sigs. There are 10 types of people in the world - those that understand binary and those that don't! Link to comment Share on other sites More sharing options...
zeldan Posted October 27, 2006 Author Share Posted October 27, 2006 thats the answer my othr person said too =\ but whats the answer to 2 and 3? Link to comment Share on other sites More sharing options...
icecube Posted October 27, 2006 Share Posted October 27, 2006 thats the answer my othr person said too =\ but whats the answer to 2 and 3? vlad_the_old had the answer to number 2 in his other post. Not sure about number 3. Link to comment Share on other sites More sharing options...
zeldan Posted October 27, 2006 Author Share Posted October 27, 2006 hmm, kk, think i might have it worked out now, thx guys, u are welcome to add me on rs anytime :) Link to comment Share on other sites More sharing options...
D. V. Devnull Posted October 27, 2006 Share Posted October 27, 2006 You're welcome? :-s BTW, to all Admins and Mods, I ask that this thread be made a sticky... This question has been asked so many times while I have been here that it is not funny anymore to have thread upon thread show up. So, PLEASE, sticky it? :pray: ~Mr. Devnull and normally with a cool mind.(Warning: This user can be VERY confusing to some people... And talks in 3rd person for the timebeing due to how insane they are... Sometimes even to themself.) Link to comment Share on other sites More sharing options...
Kinslayer777 Posted October 27, 2006 Share Posted October 27, 2006 ^Supports... Link to comment Share on other sites More sharing options...
vlad_the_old Posted October 27, 2006 Share Posted October 27, 2006 Fields that they use to accumulate values are probably integer fields and these have a maximum length of 4 bytes. Stepping back a bitÃÆââââ¬Å¡Ã¬Ãâæ Computers work in binary so can accept a value of 0 or 1. Each character you see is a byte and these are made up of 8 bits so the number 8 you see on your screen is 00001000 in binary which is represented as 38 in Hexadecimal (I am talking ASCII characters here not EBCIDIC). So back to our integer field ÃÆââââ¬Å¡Ã¬Ã¢ââ¬Ãâ this has a maximum value of 4,294,967,295 shown as FFFF FFFF in hexadecimal or 11111111111111111111111111111111 in binary. This maximum value is unsigned i.e. we do not know if it is a + or a minus. In order to get around this the high order bit (that is the 1 at the far left), is designated as the one that will determine if the field is positive or negative (0 = + 1 = - ) This means the maximum value that can be stored is halved as now FFFF FFFF represents -2,147,483,647 and 7FFF FFFF is +2,147,483,647. So back to binary and +2,147,483,647 is shown as 01111111111111111111111111111111. If 1 is added to this we get 10000000000000000000000000000000. As the high order bit has been switched and we are treating the field as signed the value is not +2,147,483,648 it is ÃÆââââ¬Å¡Ã¬Ã¢ââ¬Ãâ1 (could be ÃÆââââ¬Å¡Ã¬Ã¢ââ¬Ãâ0,been a while since I played with this but you get my point). Here ends lesson 101 in computing ÃÆââââ¬Å¡Ã¬Ã¢ââ¬Ãâ and I think you will find the answers to all 3 questions contained in there. :wink: Thanks to 4be2jue for the sigs. There are 10 types of people in the world - those that understand binary and those that don't! Link to comment Share on other sites More sharing options...
sessie Posted October 27, 2006 Share Posted October 27, 2006 In 2-complement 10000000000000000000000000000000 is actually -2,147,483,648 and 11111111111111111111111111111111 is -1. If you add 1 to 11111111111111111111111111111111 you get a so called overflow which is not really a problem in this system since the next number is 00000000000000000000000000000000 which represents 0. Link to comment Share on other sites More sharing options...
vlad_the_old Posted October 27, 2006 Share Posted October 27, 2006 In 2-complement 10000000000000000000000000000000 is actually -2,147,483,648 and 11111111111111111111111111111111 is -1. If you add 1 to 11111111111111111111111111111111 you get a so called overflow which is not really a problem in this system since the next number is 00000000000000000000000000000000 which represents 0. Thanks for that. As I said, been a while since I played around at this low a level. :oops: Thanks to 4be2jue for the sigs. There are 10 types of people in the world - those that understand binary and those that don't! Link to comment Share on other sites More sharing options...
mot235 Posted October 27, 2006 Share Posted October 27, 2006 lol are you all math genies like FFFF FFFF=*put the right cypher here* and 1111111111111=*put right cypher here*? Visit my blog! http://forum.tip.it/viewtopic.php?f=98&t=802155&p=6791946#p6791946 Link to comment Share on other sites More sharing options...
D. V. Devnull Posted October 27, 2006 Share Posted October 27, 2006 lol are you all math genies like FFFF FFFF=*put the right cypher here* and 1111111111111=*put right cypher here*? Actually, they're trying they're best to give a dumbed-down explanation of "computer-binary-ese" language... Sadly, being a tech wacko myself, that's something that I know is kinda hard to do! :oops: :( ~Mr. Devnull (STILL REQUESTING THREAD STICKY!!!) and normally with a cool mind.(Warning: This user can be VERY confusing to some people... And talks in 3rd person for the timebeing due to how insane they are... Sometimes even to themself.) Link to comment Share on other sites More sharing options...
Goobore Posted October 27, 2006 Share Posted October 27, 2006 1. What is the maximum amount of money any rs player can have (must be exact) (2^31)-1 2,147,483,647 2. Why is that number the maximum amount? Because a signed, 32 bit number is what RS uses. 3. what happens if you have that amount and try to add more money? It depends on how the Jagex complier of Runescipt handles signed overflow errors. Generally speaking, either it will crash or "overflow" to a large negative number. If you were working with a 4 bit signed number, you could represent numbers from -8 to +7 So, if you had +7 and added 1 to it (0111 + 0001) you would get 1000 in binary which is -8 in the number scheme used. That may or may not be noticed by the system. Consider what happens on old cars when they pass 99999 miles. The odometer rolls over to start back at 0. (The car that I ride in has already done that twice!) Another example, I had a Monopoly program that I used to play against. The max number used was 2^15-1 (32767) So I managed to get $32000 in my bank and then the computer landed on my Boardwalk full of Hotels and had to pay me $2000. So my total cash was $32000+$2000 = $34000 That is greater than 32767 and "signed overflowed" the number to -31536 At that point that computer saw that I was "bankrupt" and promptly declared itself the winner! #-o Lol Hope this helps Link to comment Share on other sites More sharing options...
Sirscrap Posted October 27, 2006 Share Posted October 27, 2006 wow i came here to find out the max money and got a headache Click sig for blog ^^ 6,627th to 99 fletching33,986th to 99 attack4,871st to 99 thieving Whip drops: 28 / Dark Bows: 7 / Hexcrests: 7 / Focus Sights: 1 / Staffs of Light: 6 / Dragon Chainbodies: 2 (1 KQ Solo 1 Dust Devil) Link to comment Share on other sites More sharing options...
D. V. Devnull Posted October 27, 2006 Share Posted October 27, 2006 Another example, I had a Monopoly program that I used to play against. The max number used was 2^15-1 (32767) So I managed to get $32000 in my bank and then the computer landed on my Boardwalk full of Hotels and had to pay me $2000. So my total cash was $32000+$2000 = $34000 That is greater than 32767 and "signed overflowed" the number to -31536 At that point that computer saw that I was "bankrupt" and promptly declared itself the winner! #-o Lol I always thought the computer cheated. Thanks for the Proof. :D ~Mr. Devnull and normally with a cool mind.(Warning: This user can be VERY confusing to some people... And talks in 3rd person for the timebeing due to how insane they are... Sometimes even to themself.) Link to comment Share on other sites More sharing options...
bicycleboy Posted October 27, 2006 Share Posted October 27, 2006 WOW there are some computer nerds/geniuses present Link to comment Share on other sites More sharing options...
zeldan Posted October 27, 2006 Author Share Posted October 27, 2006 thanks everyone :) you were all great helps :) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now