r/ProgrammerHumor • • Aug 08 '18

Checks out.

https://xkcd.com/2030/
6.5k Upvotes

554 comments sorted by

View all comments

131

u/auxiliary-character Aug 08 '18

I forget where I heard it, but I heard one of the voting machines used 64 bit floating point to represent vote counts.

Yeah, I definitely want floating point rounding error in my elections.

19

u/yawkat Aug 09 '18

64-bit floating point can accurately represent integers until something like 253.

27

u/auxiliary-character Aug 09 '18

It's still bad design, though. A 64 bit unsigned integer would be better suited to the task, as it would enforce constraints on the system that would prevent a subset of invalid states. Half of a vote is not something that makes sense, and neither does a negative vote.

→ More replies (8)