I've seen the data declarations, and it's just lazy programming (and design).
The voting system provides support for distributing a single vote among multiple candidates, because there are elections held that way in the US:
https://en.wikipedia.org/wiki/Cumulative_voting
But, for a normal election, the field should be declared as an integer (or long, depending on the architecture of the underlying hardware). All operations should be simple addition.
If you declare a value as floating point, you can't guarantee it will remain a value that can be represented by an integer.
The problem: floating point arithmetic in base 2 results in small errors creeping into the result, especially over millions of calculations. And once a fractional error creeps into the result, it may not be able to be represented exactly in base 2, resulting in more errors.
I've seen the data declarations, and it's just lazy programmers.
The voting system provides support for distributing a single vote among multiple candidates, because there are elections held that way in the US:
https://en.wikipedia.org/wiki/Cumulative_voting
But, for a normal election, the field should be declared as an integer (or long, depending on the architecture of the underlying hardware). All operations should be simple addition.
If you declare a value as floating point, you can't guarantee it will remain a value that can be represented by an integer.
The problem: floating point arithmetic in base 2 results in small errors creeping into the result, especially over millions of calculations. And once a fractional error creeps into the result, it may not be able to be represented exactly in base 2, resulting in more errors.