PDA

View Full Version : PokerTracker uses signed 32-bit integers, OVERFLOW!!!!


barycentric
06-04-2005, 07:55 AM
PartyPoker and its skins passed the 2^31 = 2147483648 hands in the last 6 hours. As a result, all the hands that are imported into PokerTracker have overflow problem as their hand # show up as negative. In signed 32-bit integers, integers between 2147483648 and 4294967295 are negative. This doesn't affect PT's functionality, but I just thought it was hilarious.

Dazarath
06-04-2005, 09:31 AM
Haha, I just took a look. Pat said he's going to look into fixing it later today (I think) with a patch.

ptrack mike
06-04-2005, 10:33 AM
I can confirm that Pat and I are working on PTH and PTO patches right now.

Stormwolf
06-04-2005, 10:41 AM
Is something on PT malfuntioning currently?

Dazarath
06-04-2005, 11:25 AM
It's not a malfunction (well, not a major one at least); it's an overflow issue like barycentric said. PT uses 32-bit signed integers to store the hand history numbers. That means the range of values it can store are between +2^31-1 and -2^31, inclusive. So when the hand history number exceeds 2^31-1, the value actually represents a negative value.

Here's a simpler example with 3-bit integers: (Someone may want to check my math, as it's late and I haven't really slept yet.)
Binary -- Unsigned -- Signed
000 -- 0 -- 0
001 -- 1 -- 1
010 -- 2 -- 2
011 -- 3 -- 3
100 -- 4 -- -4
101 -- 5 -- -3
110 -- 6 -- -2
111 -- 7 -- -1

The left column is the bit representation in binary. The middle column is the value if it's an unsigned integer (ie. no negatives). The right column is the value if it's a signed integer (negatives allowed). As you can see, when the value exceeds 011 (3), then the values represented become negative. This is what's happening in PT. I've been using PT this morning and it seems to be working fine for the most part. I can import hand histories and everything. After the patch though, for all I know, we may have to export/reimport the hands, but that's not a big deal.