Well if you are talking about the transfer of money between differentClive George said:<gasp>
entities it will always be integral. However if you are calculating value or
costs you will find a lot of prices are not integral the price of an
electronic component, a litre of petrol, a euro. Add to that the first thing
you do when calculating present value is discount using compound interest
rates, you know you are going to need to convert to a double anyway.
If you need to round you need to round it doesn't matter how you store theI've met people's code where they've done this. I've rewritten it too. It
worked much better afterwards.
For areas where you aren't concerned about the exact answer to the penny,
then this is ok (which you imply later). But if you're doing accounts, stick
to fixed point/integer arithmetic.
There are also a number of little rounding peculiarities that can happen
when using floating point, which means that no matter how precisely you
store your number, it can still go wrong in an unhelpful manner. Be very
In my case valuation in Investment Banking options, swaps, bonds, riskDefine finance Any system I'm involved in uses integral data - but then,
it's mostly accounting, not projections/estimates (1). Any programmer
involved with one of my systems who uses floating point except where
necessary will get severly told off!
How much has your pension dropped since 2000? The stuff I write is more like(1) Do you do things like the software for writing the pension forecasts?
I'd let that use doubles, but I'd expect the software that actually handles
my pension account to use integers.
what if scenarios. What if the FTSE goes up 20% what if interest rates go