From 88814bbe98fe43ca4f3c168b7d77ebb820838e7a Mon Sep 17 00:00:00 2001 From: Palash Nigam Date: Mon, 26 Aug 2019 23:43:41 +0530 Subject: [PATCH] fixes #11832 (#12049) --- tests/parallel/tpi.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parallel/tpi.nim b/tests/parallel/tpi.nim index dcb9b8fc5e..1abed6f239 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 =