Is this an efficient way to compute the value of Pi, where the limit of j
\$\propto\$ accuracy?
PI = 0;
for (var j = 1; j < 100; j+=2) PI += (4/j)*((j+1)%4?1:-1);
The formula I used to write this is:
$$\pi \equiv \frac{4}{1}-\frac{4}{3}+\frac{4}{5}-\frac{4}{7}+\cdots$$