Post
Topic
Board Development & Technical Discussion
Re: Why the block rule "total inputs + new coin = total outputs" is not enforced
by
Come-from-Beyond
on 15/11/2013, 12:06:59 UTC
Please give a better example, they have exact representation in IEEE Smiley

They do, but long chain of computations can lead to weird results like 4.00000000561 instead of 4.

Working with floating-point numbers u shouldn't do things like

Code:
if (a == b) ...

The code should be replaced with something like

Code:
double epsilon = 1e-9;
if (a > b - epsilon && a < b + epsilon) ...

If u validate transactions/blocks the code

Code:
if (inputs == outputs) ...

can fail, u r supposed to write it as

Code:
if (inputs > outputs - epsilon) ...