News for hackers. Stuff that matters.
Re:Coinbase (YC S12) seeks to bring Bitcoin to the masses by esbwhat on Friday June 29, 2012 @02:18PM (#4178162)
What's wrong with storing it as a float? I'm not saying you're wrong, I just genuinely don't know. If you could explain/point me to relevant literature I'd be grateful.
Re:Coinbase (YC S12) seeks to bring Bitcoin to the masses by pygy_ on Friday June 29, 2012 @02:31PM (#4178240)
Some numbers with a finite representation in base 10, 0.2, for example, don't have a finite representation in base 2.

They are rounded, and doing arithmetic on such numbers leads to compounded rounding errors that you don't want to see when dealing with money.

Another problem is that the mantissa of floating point numbers is limited (52 bits for doubles), which can lead to truncated numbers, another big no no.

Re:Coinbase (YC S12) seeks to bring Bitcoin to the masses by dsterry on Friday June 29, 2012 @04:09PM (#4178788)
Storing BTC balances as floats is something a few services have done in the past so it makes sense to ask/bring up. Since BTC have 8 decimal precision, rounding can become noticeable very quickly even in addition and subtraction even though in real, today's value, it's not such a big deal.
Re:Coinbase (YC S12) seeks to bring Bitcoin to the masses by wmf on Friday June 29, 2012 @02:26PM (#4178208)
http://stackoverflow.com/questions/3730019/why-not-use-doubl...

Also, all Bitcoin calculations are supposed to be done in integer Satoshis.

Re:Coinbase (YC S12) seeks to bring Bitcoin to the masses by drivebyacct2 on Friday June 29, 2012 @02:25PM (#4178201)
Quick Google, sorry it's easier than me offering an incomplete explanation: http://stackoverflow.com/questions/3730019/why-not-use-doubl...

And I really don't mean to pick on you, but that this isn't better known is why I worry when I see random sites popup offering financial services.

Re:Coinbase (YC S12) seeks to bring Bitcoin to the masses by esbwhat on Friday June 29, 2012 @03:08PM (#4178471)
That's okay. I don't think I'm really representative anyway, as I'm not a professional/schooled programmer. Thanks for the link, I did try googling it myself but I didn't think to use the word "currency" so I just got a bunch of irrelevant results.