the equivalent of a decimal(18,8)
That's a large range... 10,000 years of global GDP, down to a millionth of a cent?
For real-world accounting, double-precision floats actually work great, but there are a lot of subtleties about it (some would say
traps).
As long as you round-off to cents regularly and religiously, doubles handle a trillion dollars no problem.
A less-controversial method is to account in cents (or hundreths of a cent) using 64-bit integers.
Intriguingly, a couple of years ago I transferred (for my parents) $$$$$$.6
1 from one bank, and $$$$$$.6
2 turned up in the receiving bank. If I put the same number through a single-precision float, the same error occurs. I'm guessing the error doesn't happen very often because large amounts are probably done in whole dollars without non-binary decimal fractions.