Fixed broken pi calc algo

This commit is contained in:
Jonas Bonér 2011-04-24 09:01:45 -07:00
parent b16108b661
commit e22113075f

View file

@ -238,7 +238,7 @@ The only thing missing in our ``Worker`` actor is the implementation on the ``ca
def calculatePiFor(start: Int, nrOfElements: Int): Double = {
var acc = 0.0
for (i <- start until (start + nrOfElements))
acc += 4 * (1 - (i % 2) * 2) / (2 * i + 1)
acc += 4.0 * (1 - (i % 2) * 2) / (2 * i + 1)
acc
}