|
From: Diogo Mildenberger <diogo.milde@gmail.com>
If you are writing financial programs for e.g. mark-to-model present value, risk and so forth, it’s quite typical for these do deal with doubles only [across huge swathes of systems in banks and investment funds]. If you are writing an accounting or taxation program, you’ll also need to cope with specific rounding schemes imposed externally in addition to the advice on fixed point given here, and should think like an accountant (double entry et al) so that you don’t introduce other forms of gap, e.g. not doing new_balance,old_balance=balance/3,2*balance/3 Regards Scott |