Partager via


The Election and Signed Integers

A colleague sent me a link to an interesting article that looks just like an integer overflow issue:

https://www.palmbeachpost.com/politics/content/news/epaper/2004/11/05/a29a_BROWVOTE_1105.html

Broward machines count backward
By Eliot Kleinberg

Palm Beach Post Staff Writer

Friday, November 05, 2004

FORT LAUDERDALE — It had to happen. Things were just going too smoothly.

Early Thursday, as Broward County elections officials wrapped up after a long day of canvassing votes, something unusual caught their eye. Tallies should go up as more votes are counted. That's simple math. But in some races, the numbers had gone . . . down.
 
Officials found the software used in Broward can handle only 32,000 votes per precinct. After that, the system starts counting backward.

Methinks the software used 16-bit signed ints!

Comments

  • Anonymous
    November 08, 2004
    I guess unsigned __int64's just aren't that popular eh?

    Here’s to overkill when counting with little fear of overflow (within reason of course)!!!
  • Anonymous
    November 08, 2004
    would it really have been that difficult to have a locally-attached laser printer spit out a page with the votes on it?

    I'm sure you're right about the cause, but how do they even know how many times it wrapped? They don't for sure (although they probably can guess). Worthless results.

    Sigh... I guess it's only an election, and not something really important like GTA...
  • Anonymous
    November 08, 2004
    Lovely. Heck, even a plain UINT would have been fine, unless the US population crossed 4 billion when I wasn't looking...
  • Anonymous
    November 08, 2004
    Probably written in VB6... by idiots.
  • Anonymous
    November 08, 2004
    Actually, Basic (including Visual Basic) will raise an exception on overflow!
  • Anonymous
    November 08, 2004
    The comment has been removed
  • Anonymous
    November 08, 2004
    The comment has been removed
  • Anonymous
    November 08, 2004
    The comment has been removed
  • Anonymous
    November 08, 2004
    Coool :)

    Well, after 32767 it's -32768 there, then -32767, -32766, so it's actually still going up :) So actually if you have result of -1, you can be rather safe in saying there were 65535 votes.

    If the software was really counting down, it might have rounded the result, which appears even more... more strange, then stupid signed 16bit int usage :)

    (BTW, looks like no one here is in any doubt that those 32,000 is == 32,767 :)
  • Anonymous
    November 09, 2004
    The comment has been removed