Posts by Glorfindel • 548 points
2 posts
-
2
votes2
answers59
viewsA: Error in the division by groups
It works: for (var i = 0; i < names.length; ++i) { if (!ret["array" + teamCounter]) { ret["array" + teamCounter] = []; } ret["array" + teamCounter].push(names[i]); if (ret["array" +…
javascriptanswered Glorfindel 548 -
2
votes2
answers611
viewsA: Java recursive function to calculate: e = 1 + 2/1 + 3/2 + 4/3 + 5/4 + ... + n/(n-1)
Substitute somatorio = termos / (funcao01(termos - 1)); for somatorio = funcao01(termos - 1) + termos / (double)(termos - 1); The double is important to avoid the whole division.…