We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USING: kernel math ; IN: leibniz : lpi ( num-of-pairs: integer -- pi ) 0.0 0 rot [ [ 4.0 * [ 3.0 + ] [ 1.0 + ] bi * 2.0 swap / + ] keep 1 + ] times drop 4 * ;
USING: kernel math ; IN: Leibniz : calcpi ( -- pi index ) 0.0 0 [ dup [ 4.0 * [ 3.0 + ] [ 1.0 + ] bi * 2.0 swap / + ] dip 1 + dup 100000000 < ] loop [ 4 * ] dip ! drop ;
100M pairs => 0.137 sec. on 2.3GHz dual core Core i5 😲
The text was updated successfully, but these errors were encountered:
shnarazk
No branches or pull requests
golfed
100M pairs => 0.137 sec. on 2.3GHz dual core Core i5 😲
The text was updated successfully, but these errors were encountered: