これまでのところ、複利を計算するにはどうすればよいですか。
 double principal = [[principalLabel text] doubleValue];
 NSLog(@"Principal: %lf",principal);
 double years = [[yearsLabel text] doubleValue];
 NSLog(@"Years: %lf",years);
 double months = [[monthsLabel text] doubleValue] / 12; 
 NSLog(@"Months: %lf",months);
 double days = ([[daysLabel text] doubleValue] / 365) / 10;
 NSLog(@"Days :%lf",days);
 double rate = ([[rateLabel text] doubleValue] / 100);
 NSLog(@"Rate: %lf",rate);
 double time = years + days + months;
 NSLog(@"Time: %lf",time);
 double total = pow(principal * (1 - rate), time);
 NSLog(@"Total: %lf",total);
 double interest = pow(principal * (1 - rate), time) - principal;
 NSLog(@"Interest: %lf",interest);
 NSString *interestString = [[NSString alloc] initWithFormat:@"%lf",interest];
 NSString *totalString = [[NSString alloc] initWithFormat:@"%lf",total];
 [interestLabel setText:interestString];
 [totalLabel setText:totalString];
ご覧のとおり、プリンシパル、レート、年、月、日に対して5つのUITextFieldがあります。現時点では、数学が正しいように見えても、実際の答えにはほど遠い答えが得られ続けています。コードを徹底的に確認しましたが、解決策は見つかりませんでした。
My desired result is: E.g.     
M = P * (1+R)^Y              
M = 1000 * (1+0.10)^2       
M = 1210