Share your repls and programming experiences

← Back to all posts
π in APL
AmazingMech2418 (1102)

@TheForArkLD recommended that I make a pi approximation in APL, so here it is! By the way, I don't know if I did it the way you are technically supposed to, but it works! APL has almost no available documentation online...

RahulChoubey1 (184)

@AmazingMech2418 where can I find documentation?

AmazingMech2418 (1102)

@RahulChoubey1 I just looked up Wikipedia articles honestly. LOL!

theangryepicbanana (1701)

You could probably simplify this whole thing:




because I believe the APL evaluates from right to left (rather than left to right). It might even be able to be simplified further.

AmazingMech2418 (1102)

@theangryepicbanana I just simplified it as far as I can.

TheForArkLD (770)

Thanks :D
Really cool!
(Dyalog is our friends)

AmazingMech2418 (1102)

@TheForArkLD I don't think uses Dyalog. Loops don't work. I had to use tail-end recursion.

AmazingMech2418 (1102)

@TheForArkLD Well, ngn doesn't support loops with the same syntax as Dyalog...

AmazingMech2418 (1102)

@TheForArkLD You have to use tail-end recursion though...

TheForArkLD (770)

@AmazingMech2418 yes

⍝Do something
{n < max:func 1} 1
func 1
TheForArkLD (770)

@AmazingMech2418 I found symbol that recursion for function, lol

TheForArkLD (770)

good news