wtf.... the techdev committee should just come out and say that nobody gets any unclaimed coins bounty from code uzilizing any kind of float data type.
I mean, I appreciate james' dedication and his skill in all the work hes doing, allbeit on no-quite-so trustless-systems work, as most likely they will be replaced by fully decentralized and trustless systems, but we just do NOT need any floating points running around
Currently, I use floating in exactly one place. For calculating allocation of nodecoins. My usage has been approved by CfB. mthcl agreed with my math analysis. Others agreed that for my use case, there is nothing wrong with using floating point.
I make engineering decision based on tradeoffs of accuracy, implementation time, code stability. My assessment was to use 64 bit floating point for allocation. This is because floating point is just as accurate, if not more, when approximating fractions.
The reason integer math is more accurate for financial applications is because there is a least common denominator (satoshi, cent) and so all calculations can be done without errors. As long as you dont overflow.
With pool allocations, you end up with fractions without any reasonable least common denominator. That means you get errors representing it with 64 bit ints or 64 bit floats. However, floats are designed to dynamically adapt to the scale of the numbers while with integers you need a fixed multiplier. The fixed multiplier needs to deal with worst case while at the same time avoiding overflow.
So, using integers for this use case would not be any more accurate and instead open to overflow, or if to avoid overflow you get higher error rates.
The other reason that integer math is preferred in crypto is that all computers end up with the same result. This is important in synchronizing blockchain. however, my code is running on controlled servers and there is no need for synchronizing.
This "never use floating point" requirement seems to be dictating usage of inferior solutions in some use cases. I prefer to think about what I am doing and choose the appropriate solution.
If you have any math based feedback, I am eager to hear it. Superstitous, ban all floating point, is not really constructive.
James
P.S. I could get better accuracy if I used 128 bit floats and near perfect accuracy using 128 bits ints, but I do not trust the code libraries for doing 128 bit math as much as floating point silicon in Intel processors. In any case, do people really need their nodecoins allocated more accurately than .0000000000001 nodecoins?