Last active
August 2, 2024 16:25
-
-
Save nickbauman/64c26acf4a6d8b71bc14021a9d000da4 to your computer and use it in GitHub Desktop.
Future value of investment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package future_value | |
import "math" | |
func futureValue(investmentAmount, interestRate, inflationRate, years float64) (float64, float64) { | |
furtureValue := investmentAmount * math.Pow(1+interestRate/100, years) | |
futureRealValue := furtureValue / math.Pow(1+inflationRate/100, years) | |
return furtureValue, futureRealValue | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment