Integer limit
Vmlweb
Member Posts: 427
Hey
Is there any limit to the size of the number that can be stored in an Integer?
Because I am making a number encoding system in my game which can store multiple numbers in 1 number and can add to a given number or can extract it.
This way I can store the highscores for the whole game in 1 attribute and have 1 rule that checks if there is a new highscores instead of 30 rules.
Thanks,
Vmlweb
Is there any limit to the size of the number that can be stored in an Integer?
Because I am making a number encoding system in my game which can store multiple numbers in 1 number and can add to a given number or can extract it.
This way I can store the highscores for the whole game in 1 attribute and have 1 rule that checks if there is a new highscores instead of 30 rules.
Thanks,
Vmlweb
Comments
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
try storing a number bigger than mulcahey said in a integer
Google the wiki on 32bit integers.
These are unsigned...
Oddly enough Indexes (aka Integers that can only be positive) still only go up to positive 2bil, not 4billion as would be expected from an unsigned int.
I would be very curious to see how you encode the values. I was trying to do something similar before but gave up on it due to lack of bitwise operators in Lua.
floats are bigger than ints.
Try it... take an int, assign it 2billion or so, and then put it inside a really fast timer that adds 1000 to it every nanosecond. DisplayText and watch the value climb. At 2^32-1 it will start to wrap and the value will begin to count down.
I'm soo curious what your encoding scheme is though. Like I said before, I tried to do this but without bitwise operators I gave up.
It also looks like it has a limit. That limit can be increased by setting the value of the number down