Pi: Difference between revisions

27 bytes added ,  1 year ago
m
→‎{{header|zkl}}: updated syntaxhighlight lang=, etc...
m (→‎{{header|D}}: updated syntaxhighlight lang=, etc...)
m (→‎{{header|zkl}}: updated syntaxhighlight lang=, etc...)
Line 6,129:
Uses the GMP big int library.
Same algorithm as many of the others on this page. Uses in place ops to cut down on big int generation (eg add vs +). Unless GC is given some hints, it will use up 16 gig quickly as it outruns the garbage collector.
<langsyntaxhighlight lang=zkl>var [const] BN=Import("zklBigNum"),
one=BN(1), two=BN(2), three=BN(3), four=BN(4), seven=BN(7), ten=BN(10);
 
Line 6,152:
}
}
}();</langsyntaxhighlight>
Runs until ^C hit, the first 1000 digits match the D output.
{{out}}