Pi: Difference between revisions

2,496 bytes added ,  3 years ago
Added Quackery.
m (→‎Quicker, unverified algo: exchanged some multiplies for additions, increasing performance slightly)
(Added Quackery.)
Line 4,317:
...
</pre>
 
=={{header|Quackery}}==
{{trans Oforth}}
 
Quackery does not have variables, it has ancillary stacks. To expedite translation from Oforth, the first two lines implement words equivalent to the [https://forth-standard.org/standard/core/VALUE Forth words VALUE and TO].
<lang Quackery> [ ]this[ share ]done[ ] is value ( --> x )
[ ]'[ replace ] is to ( x --> )
[ value 1 ] is Q ( --> x )
[ value 0 ] is R ( --> x )
[ value 1 ] is T ( --> x )
[ value 1 ] is K ( --> x )
[ value 3 ] is N ( --> x )
[ value 3 ] is L ( --> x )
[ value 0 ] is chcount ( --> x )
[ echo
chcount dup 79 =
if cr
1+ 80 mod to chcount ] is printch
 
[ 4 Q * R + T - N T * < iff
[ N printch
R N T * - 10 *
3 Q * R + 10 * T / N 10 * - to N to R
Q 10 * to Q ]
else
[ 2 Q * R + L *
7 K * Q * 2 + R L * + T L * / to N to R
K Q * to Q
T L * to T
L 2 + to L
K 1+ to K ]
chcount again ]</lang>
 
{{out}}
 
<pre>31415926535897932384626433832795028841971693993751058209749445923078164062862089
98628034825342117067982148086513282306647093844609550582231725359408128481117450
28410270193852110555964462294895493038196442881097566593344612847564823378678316
52712019091456485669234603486104543266482133936072602491412737245870066063155881
74881520920962829254091715364367892590360011330530548820466521384146951941511609
43305727036575959195309218611738193261179310511854807446237996274956735188575272
48912279381830119491298336733624406566430860213949463952247371907021798609437027
70539217176293176752384674818467669405132000568127145263560827785771342757789609
17363717872146844090122495343014654958537105079227968925892354201995611212902196
08640344181598136297747713099605187072113499999983729780499510597317328160963185
95024459455346908302642522308253344685035261931188171010003137838752886587533208
38142061717766914730359825349042875546873115956286388235378759375195778185778053
21712268066130019278766111959092164201989380952572010654858632788659361533818279
68230301952035301852968995773622599413891249721775283479131515574857242454150695
95082953311686172785588907509838175463746493931925506040092770167113900984882401
28583616035637076601047101819429555961989467678374494482553797747268471040475346
</pre>… and so on.
 
 
=={{header|R}}==
1,462

edits