Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Shift-6 character in a calculation
Message
De
22/03/2003 12:29:11
 
 
À
22/03/2003 12:11:54
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00768921
Message ID:
00768928
Vues:
21
This message has been marked as the solution to the initial question of the thread.
Renoir, the formula to calculate simple compound interest is:
nCompVal = nStartVal * ( 1 + i ) ^ n where

i=interest rate
n=number of compounding periods
So a start value of 100 compounded at 10% interest for 5 period (eg take $100 and invest at 10% per annum for 5 years) would be:
nCompVal = 100 * ( 1 + 10/100 ) ^ 5 
? nCompVal  && returns 161.05
Assuming my memory serves me correctly which is a big "if" :)


What your original formula is trying to do (I think) is first convert an annual rate to a daily rate and then compounding the nOldValue for some type of pro-rata number of days. It would be simplified by:
nNewValue = nOldValue * ( 1 + ( (nInterestRate/100) / 365 ) ) ^ nDays
But I am not sure this will give the answer required as I am not sure you can convert an annual rate to a daily rate like this?


>Jos,
>
>Y'know, I kind of thought that, but given this calculation:
>
>
>nNewValue = (nOldValue * ((1 + nInterestRate/(365*100))^(365 * nDays / 365)))
>
>
>I couldn't see what they were trying to do (other than incorrectly use 365 to annualize).
>
>Jay
>
>>Renoir, it is the "power to" function. Same as double asterisk **. i.e. 4^2 = 16 and 4**2 = 16
>>
>>
>>>What would the "^" character do in a calculation? Can't seem to locate it anywhere.
>>>
>>>Renoir
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform