bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-apl] Help using the power operator


From: Elias Mårtenson
Subject: [Bug-apl] Help using the power operator
Date: Fri, 30 Oct 2015 18:01:44 +0800

I was trying out an iterative solution to computing the value of π, being a sum of a simple formula. I made a straightforward implementation like so:

      4×+/{(¯1*⍵+1)÷¯1+2×⍵}¨⍳1000000

The above _expression_ performs 1 million iterations, but is also allocates a 1 million element array to do so.

Is there a simple and natural way to perform this computation in an iterative manner using the power operator (⍣)?

Regards,
Elias

reply via email to

[Prev in Thread] Current Thread [Next in Thread]