Skip to content

Instantly share code, notes, and snippets.

@kineticz
Created January 19, 2015 21:41
Show Gist options
  • Select an option

  • Save kineticz/cfc44a1d7d2f96decfd5 to your computer and use it in GitHub Desktop.

Select an option

Save kineticz/cfc44a1d7d2f96decfd5 to your computer and use it in GitHub Desktop.
;; compound interest with the -> macro
(defn final-amount-> [principle rate time-periods]
(-> rate
(/ 100)
(+ 1)
(Math/pow time-periods)
(* principle)))
(final-amount-> 100 20 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment