Skip to content

Instantly share code, notes, and snippets.

@debugging
Created September 12, 2021 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debugging/3b0f2eabec376a426c4f7419f68b3da7 to your computer and use it in GitHub Desktop.
Save debugging/3b0f2eabec376a426c4f7419f68b3da7 to your computer and use it in GitHub Desktop.
Compound calculator
// compound growth calculator
val principal = 25000
val rate = 0.01
val n = 1
val t = 20
val total = principal * Math.pow(1 + (rate/n), n*t)
println(total)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment