Fixed broken pi calc algo
This commit is contained in:
parent
b16108b661
commit
e22113075f
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue