Created
July 23, 2012 14:50
-
-
Save renatoargh/3164029 to your computer and use it in GitHub Desktop.
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
| function somatorio(inicio, final, funcao){ | |
| if(!funcao) | |
| funcao = function(i) { return i; }; | |
| var acumulador = 0; | |
| for(i = inicio; i <= final; i++){ | |
| acumulador += funcao(i, acumulador); | |
| } | |
| return acumulador; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment