[Solved] Future value function in iPhone SDK


No, neither Objective-C nor Apple’s frameworks include specific financial functions.

It’s trivial to implement. The Wikipedia article you link to includes the formula. You might also want to consider something like QuantLib if you ever get onto more sophisticated calculations.

The formula — copied from the Wikipedia article you linked to — is:

FV = PV . (1 + i) ^ t

This can be converted into Objective-C mainly by typing:

  float fv, pv, i, t;

  pv = 200000.0; // present value
  i  = 0.012;    // interest rate (1.2%)
  t  = 5.0;      // time period

  fv = pv * pow (1.0 + i, t);

4

solved Future value function in iPhone SDK