summary refs log tree commit diff stats
path: root/tinyc/tests/tests2/19_pointer_arithmetic.expect
blob: 0cf781b9e5ce9ceb9a118340da82f88fef08f777 (generated by cgit-pink 1.4.1-2-gfad0 (git 2.36.2.497.gbbea4dcf42) at 2025-06-25 00:38:28 +0000
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..ch.high: ch[k] = spawn term(float(k)) for k in 0..ch.high: result += ^ch[k] proc piS(n: int): float = var ch = newSeq[float](n+1) parallel: for k in 0..ch.high: ch[k] = spawn term(float(k)) for k in 0..ch.high: result += ch[k] echo formatFloat(piU(5000)) echo formatFloat(piS(5000))