Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
batterseapower
on June 21, 2011
|
parent
|
context
|
favorite
| on:
I'm the guy who bought 259684 Bitcoins for under $...
There are 21 million bitcoins and they divide down to 8dp, so you need 16 decimal digits to represent them exactly. Coincidentally (?) double precision floating point is capable of precisely representing exactly 16 decimal digits.
http://en.wikipedia.org/wiki/Double_precision
So using double is in fact perfectly OK in this case.
TylerE
on June 21, 2011
[–]
16 digits of precision != 16 digits of accuracy.
tedunangst
on June 21, 2011
|
parent
[–]
Doubles are capable of accurately and precisely representing 16 digit decimal numbers.
JeffL
on June 22, 2011
|
root
|
parent
[–]
Not 10^100 + 0.0000000000000001
tedunangst
on June 22, 2011
|
root
|
parent
[–]
A 116 digit number is not a 16 digit number.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
http://en.wikipedia.org/wiki/Double_precision
So using double is in fact perfectly OK in this case.