Skip to content

Instantly share code, notes, and snippets.

@harukizaemon
Created August 17, 2009 06:48
Show Gist options
  • Save harukizaemon/168956 to your computer and use it in GitHub Desktop.
Save harukizaemon/168956 to your computer and use it in GitHub Desktop.
tax n
| n > 60000 = calc n 60000 0.45
| n > 30000 = calc n 30000 0.30
| n > 15000 = calc n 15000 0.15
| otherwise = 0
where calc n t r = ((n - t) * r) + tax t
> tax 72000
=> 16500.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment