summary refs log tree commit diff stats
path: root/tests/parallel/tpi.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/parallel/tpi.nim')
-rw-r--r--tests/parallel/tpi.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/parallel/tpi.nim b/tests/parallel/tpi.nim
index dcb9b8fc5..1abed6f23 100644
--- a/tests/parallel/tpi.nim
+++ b/tests/parallel/tpi.nim
@@ -9,9 +9,9 @@ proc term(k: float): float = 4 * math.pow(-1, k) / (2*k + 1)
 
 proc piU(n: int): float =
   var ch = newSeq[FlowVar[float]](n+1)
-  for k in 0..n:
+  for k in 0..ch.high:
     ch[k] = spawn term(float(k))
-  for k in 0..n:
+  for k in 0..ch.high:
     result += ^ch[k]
 
 proc piS(n: int): float =