Last active
August 29, 2015 14:05
-
-
Save jprudent/a2c405ad16a5d9dee6fb to your computer and use it in GitHub Desktop.
Calcul du revenu d'imposition
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
(let [revenu 50000 | |
tranches [ [0 6011 0.] [6011 11991 0.055] [11991 26631 0.14] [26631 71397 0.3] [71397 151200 0.41]]] | |
(reduce | |
(fn [total [tmin tmax coeff]] | |
(let [m-in-tranche (- (min tmax revenu) tmin)] | |
(+ total (max 0 (* m-in-tranche coeff))))) | |
0 | |
tranches)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment