Handbook
Glossary
find-pi-to ( accuracy -- n approx )
Vocabulary
benchmark
.
find-pi
Inputs
accuracy
an
object
Outputs
n
an
object
approx
an
object
Definition
USING:
kernel
math
;
IN:
benchmark.find-pi
::
find-pi-to
( accuracy -- n approx )
1 4
[
over
[
2
*
1
+
]
[
odd?
[
neg
]
when
]
bi
4
swap
/
[
+
]
keep
abs
accuracy
>=
[
1
+
]
2dip
]
loop
;