Use a long with the amount in satoshi. Then when you need to convert to display an amount, just divide by 100000000
Wot he sez.
When you're dealing with money, forget about floating point, instead use fixed point numbers with the right number of decimals if your programming language has them, or just integer numbers in the smallest unit that you want to deal with (then you need to remember to insert a decimal point when talking to the outside world.)
Binary floating point cannot represent decimal fractional numbers exactly. This is not a fault in the programming language or its libraries, it's just a natural limitation when using fractional numbers and switching between different bases.
Onkel Paul